From b815412da9c9b719ecbfa9b9df41ccaedefdf963 Mon Sep 17 00:00:00 2001 From: michaelkrone Date: Wed, 18 Oct 2017 23:09:17 +0200 Subject: [PATCH 01/26] feat: WIP serializable actions, bump normalizr version, updated docs --- docs/assets/js/search.js | 2 +- docs/classes/_actions_normalize_.adddata.html | 33 +- ...tions_normalize_.normalizeactiontypes.html | 22 +- .../_actions_normalize_.removedata.html | 36 ++- docs/classes/_actions_normalize_.setdata.html | 33 +- ...ons_normalize_.normalizeactionconfig.html} | 48 +-- ...ns_normalize_.normalizeactioncreators.html | 22 +- ...ons_normalize_.normalizeactionpayload.html | 283 ++++++++++++++++ ...rmalize_.normalizeactionschemaconfig.html} | 38 ++- ...rmalize_.normalizeremoveactionconfig.html} | 50 +-- ...rmalize_.normalizeremoveactionpayload.html | 303 ++++++++++++++++++ .../_actions_normalize_.schemamap.html | 18 +- ...cers_normalize_.normalizedentitystate.html | 4 +- .../_reducers_normalize_.normalizedstate.html | 2 +- .../_reducers_normalize_.schemaselectors.html | 8 +- docs/modules/_actions_normalize_.html | 28 +- docs/modules/_reducers_normalize_.html | 26 +- package.json | 6 +- src/actions/normalize.spec.ts | 73 ++++- src/actions/normalize.ts | 118 ++++++- src/reducers/normalize.ts | 18 +- yarn.lock | 6 +- 22 files changed, 972 insertions(+), 205 deletions(-) rename docs/interfaces/{_actions_normalize_.normalizedatapayload.html => _actions_normalize_.normalizeactionconfig.html} (85%) create mode 100644 docs/interfaces/_actions_normalize_.normalizeactionpayload.html rename docs/interfaces/{_actions_normalize_.schemapayload.html => _actions_normalize_.normalizeactionschemaconfig.html} (87%) rename docs/interfaces/{_actions_normalize_.normalizeremovepayload.html => _actions_normalize_.normalizeremoveactionconfig.html} (84%) create mode 100644 docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 9a15607..bcc1555 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"External module","65536":"Type literal"},"rows":[{"id":0,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#setdata.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.setData"},{"id":1,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#adddata.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.addData"},{"id":2,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#removedata.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.removeData"},{"id":3,"kind":65536,"name":"__type","url":"interfaces/_reducers_normalize_.schemaselectors.html#entityprojector.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"reducers/normalize\".SchemaSelectors.entityProjector"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_reducers_normalize_.schemaselectors.html#entitiesprojector.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"reducers/normalize\".SchemaSelectors.entitiesProjector"},{"id":5,"kind":65536,"name":"__type","url":"modules/_reducers_normalize_.html#initialstate.entities.__type","classes":"tsd-kind-type-literal tsd-parent-kind-variable tsd-is-not-exported","parent":"\"reducers/normalize\".initialState.entities"},{"id":6,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"External module","65536":"Type literal"},"rows":[{"id":0,"kind":65536,"name":"__type","url":"interfaces/_reducers_normalize_.schemaselectors.html#entityprojector.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"reducers/normalize\".SchemaSelectors.entityProjector"},{"id":1,"kind":65536,"name":"__type","url":"interfaces/_reducers_normalize_.schemaselectors.html#entitiesprojector.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"reducers/normalize\".SchemaSelectors.entitiesProjector"},{"id":2,"kind":65536,"name":"__type","url":"modules/_reducers_normalize_.html#initialstate.entities.__type","classes":"tsd-kind-type-literal tsd-parent-kind-variable tsd-is-not-exported","parent":"\"reducers/normalize\".initialState.entities"},{"id":3,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#setdata.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.setData"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#adddata.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.addData"},{"id":5,"kind":65536,"name":"__type","url":"interfaces/_actions_normalize_.normalizeactioncreators.html#removedata.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property tsd-is-not-exported","parent":"\"actions/normalize\".NormalizeActionCreators.removeData"},{"id":6,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]}; \ No newline at end of file diff --git a/docs/classes/_actions_normalize_.adddata.html b/docs/classes/_actions_normalize_.adddata.html index 68576c6..8c70d5d 100644 --- a/docs/classes/_actions_normalize_.adddata.html +++ b/docs/classes/_actions_normalize_.adddata.html @@ -125,13 +125,13 @@

Constructors

constructor

-

Interface SchemaPayload

+

Interface NormalizeActionSchemaConfig

@@ -80,13 +80,13 @@

Interface SchemaPayload

Hierarchy

-

Interface NormalizeRemovePayload

+

Interface NormalizeRemoveActionConfig

@@ -81,10 +81,10 @@

Interface NormalizeRemovePayload

Hierarchy

-

Returns (Anonymous function)

+

Returns MemoizedSelector<__type, T[]>

- -

createEntitiesSelector

+ +

createEntityProjector

-

Returns MemoizedSelector<__type, T[]>

+

Returns (Anonymous function)

-
- -

createEntityProjector

-
+
+ +

Static REMOVE_CHILD_DATA

+
REMOVE_CHILD_DATA: string = `${ACTION_NAMESPACE} Remove Child Data`
+ +
+
+

Action type of the RemoveChildData action.

+
+
+

Static REMOVE_DATA

REMOVE_DATA: string = `${ACTION_NAMESPACE} Remove Data`
@@ -145,11 +169,7 @@

Static SET_DATA

SET_DATA: string = `${ACTION_NAMESPACE} Set Data`
diff --git a/docs/classes/_actions_normalize_.removechilddata.html b/docs/classes/_actions_normalize_.removechilddata.html new file mode 100644 index 0000000..84af763 --- /dev/null +++ b/docs/classes/_actions_normalize_.removechilddata.html @@ -0,0 +1,357 @@ + + + + + + RemoveChildData | ngrx-normalizr + + + + + +
+
+
+
+ +
+
+ Options +
+
+ All +
    +
  • Public
  • +
  • Public/Protected
  • +
  • All
  • +
+
+ + + + + + +
+
+ Menu +
+
+
+
+
+
+ +

Class RemoveChildData

+
+
+
+
+
+
+
+
+
+

Action for removing data from the store. + Also see NormalizeRemovePayload.

+
+
+
+
+

Hierarchy

+
    +
  • + RemoveChildData +
  • +
+
+
+

Implements

+
    +
  • Action
  • +
+
+
+

Index

+
+
+
+

Constructors

+ +
+
+

Properties

+ +
+
+
+
+
+

Constructors

+
+ +

constructor

+ + +
+
+
+

Properties

+
+ +

payload

+ + +
+
+

The payload will be an object of the normalized entity map as entities + and the original sorted id's as an array in the result property.

+
+
+
+
+ +

type

+
type: string = NormalizeActionTypes.REMOVE_CHILD_DATA
+ +
+
+

The action type: NormalizeActionTypes.REMOVE_CHILD_DATA

+
+
+
+
+
+ +
+
+
+
+

Legend

+
+
    +
  • Module
  • +
  • Object literal
  • +
  • Variable
  • +
  • Function
  • +
  • Function with type parameter
  • +
  • Index signature
  • +
  • Type alias
  • +
+
    +
  • Enumeration
  • +
  • Enumeration member
  • +
  • Property
  • +
  • Method
  • +
+
    +
  • Interface
  • +
  • Interface with type parameter
  • +
  • Constructor
  • +
  • Property
  • +
  • Method
  • +
  • Index signature
  • +
+
    +
  • Class
  • +
  • Class with type parameter
  • +
  • Constructor
  • +
  • Property
  • +
  • Method
  • +
  • Accessor
  • +
  • Index signature
  • +
+
    +
  • Inherited constructor
  • +
  • Inherited property
  • +
  • Inherited method
  • +
  • Inherited accessor
  • +
+
    +
  • Protected property
  • +
  • Protected method
  • +
  • Protected accessor
  • +
+
    +
  • Private property
  • +
  • Private method
  • +
  • Private accessor
  • +
+
    +
  • Static property
  • +
  • Static method
  • +
+
+
+
+
+

Generated using TypeDoc

+
+
+ + + + \ No newline at end of file diff --git a/docs/classes/_actions_normalize_.removedata.html b/docs/classes/_actions_normalize_.removedata.html index 3f30fb7..408dbbd 100644 --- a/docs/classes/_actions_normalize_.removedata.html +++ b/docs/classes/_actions_normalize_.removedata.html @@ -123,11 +123,7 @@

constructor

  • @@ -154,11 +150,7 @@

    payload

    @@ -174,11 +166,7 @@

    type

    type: string = NormalizeActionTypes.REMOVE_DATA
    diff --git a/docs/classes/_actions_normalize_.setdata.html b/docs/classes/_actions_normalize_.setdata.html index 04af51c..0b2864d 100644 --- a/docs/classes/_actions_normalize_.setdata.html +++ b/docs/classes/_actions_normalize_.setdata.html @@ -131,11 +131,7 @@

    constructor

  • @@ -167,11 +163,7 @@

    payload

    @@ -187,11 +179,7 @@

    type

    type: string = NormalizeActionTypes.SET_DATA
    diff --git a/docs/index.html b/docs/index.html index 6829760..368c260 100644 --- a/docs/index.html +++ b/docs/index.html @@ -131,7 +131,7 @@

    Add, set and remove data

    Actions are used to set data in - and remove data from - the normalized store.

    Adding data

    To add data and automatically normalize it, ngrx-normalizr provides a AddData action. This action takes an object with data and schema as an argument. Entities are identified by their id attribute set in the passed schema. - Existing entities will be overwritten by updated data, new entities will be added to the store.

    + Existing entities will be overwritten by updated data, new entities will be added to the store. For adding related childs, an AddChildData action is provided.

    Using AddData in an effect
    @Effect()
     loadEffect$ = this.actions$
    @@ -144,6 +144,27 @@ 
    Using AddData in an effect
    new LoadSuccess(data) ]) .catch(err => Observable.of(new LoadFail(err))); +
    +

    Adding child data

    +

    Adding a related child data to a parent entity can be done with the AddChildData action. Note that for this to work, the relation has to be defined in the schema. The action takes a couple of arguments which need to be given in an object:

    +
      +
    • data: Array of child entities to add
    • +
    • childSchemaThe schema.Entity of the child entity
    • +
    • parentSchema: The schema.Entity of the parent entity
    • +
    • parentId: The id of the entity to add child references to
    • +
    +
    Using AddChildData in an effect
    +
    @Effect()
    +addPetEffect$ = this.actions$
    +  .ofType(ADD_PET)
    +  .switchMap(action => this.http.post('https://example.com/api/pets'))
    +  .mergeMap((data: Pet[]) => [
    +    // dispatch to add data to the store
    +    new AddChildData<Pet>({ data, childSchema, parentSchema, parentId }),
    +    // dispatch to inform feature reducer
    +    new AddPetSuccess(data)
    +  ])
    +  .catch(err => Observable.of(new LoadFail(err)));
     

    Setting data

    The SetData action will overwrite all entities for a given schema with the normalized entities of the data property of the action constructor argument. This action can @@ -163,13 +184,36 @@

    Using RemoveData in an effec new RemoveSuccess() ]) .catch(err => Observable.of(new RemoveFail(err))); + +

    Removing child data

    +

    Removing a child entity which is 1:1 related to a parent entity can be done with the RemoveChildData action. Note that for this to work, the relation has to be defined in the schema. The action takes a couple of arguments which need to be given in an object:

    +
      +
    • id: Id of the child entity that should be removed
    • +
    • childSchemaThe schema.Entity of the child entity
    • +
    • parentSchema: The schema.Entity of the parent entity
    • +
    • parentId: The id of the entity to remove child references from
    • +
    +
    Using AddChildData in an effect
    +
    @Effect()
    +removePetEffect$ = this.actions$
    +  .ofType(REMOVE_PET)
    +  .switchMap(action => this.http.remove(`https://example.com/api/pets/${action.payload.id}`))
    +  .mergeMap((data: Pet) => [
    +    // dispatch to add data to the store
    +    new RemoveChildData({ id: data.id, childSchema, parentId }),
    +    // dispatch to inform feature reducer
    +    new RemovePetSuccess(data)
    +  ])
    +  .catch(err => Observable.of(new LoadFail(err)));
     

    Action creators

    For convenience, ngrx-normalizr provides an actionCreators function which will return an object with following schema bound action creators:

    • setData - (data: T[]) => SetData<T>
    • addData - (data: T[]) => AddData<T>
    • +
    • addChildData<C> - (data: C[], childSchema: schema.Entity, parentId: string) => AddChildData
    • removeData - (id: string, removeChildren?: SchemaMap) => RemoveData
    • +
    • removeChildData - (id: string, childSchema: schema.Entity, parentId: string) => RemoveChildData

    Action creators could be exported along whith other feature actions:

    import { actionCreators } from 'ngrx-normalizr';
    @@ -209,7 +253,7 @@ 

    Creating Schema selectors

    • getEntities - MemoizedSelector<{}, T[]> Returns all denormalized entities for the schema
    • getNormalizedEntities - MemoizedSelector<any, EntityMap> Returns all normalized (raw) state entities of every schema (the whole entities state)
    • -
    • entitiesProjector - (entities: {}, ids?: Array<string>) => T[] Projector function for denormalizing a the set of normalized entities to an denormalized entity array
    • +
    • entitiesProjector - (entities: {}, ids?: Array<string>) => T[] Projector function for denormalizing a the set of normalized entities to an denormalized entity array. If no ids are given, all entities will be denormalized.
    • entityProjector - (entities: {}, id: string) => T Projector function for denormalizing a single normalized entity with the given id

    You might create several selectors with several schemas, i.e. a listView schema, which only denormalizes the data used in the list diff --git a/docs/interfaces/_actions_normalize_.normalizeactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeactionconfig.html index 7ddb16d..9a6ec7c 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionconfig.html @@ -120,11 +120,7 @@

    data

    data: T[]
    @@ -140,11 +136,7 @@

    schema

    diff --git a/docs/interfaces/_actions_normalize_.normalizeactioncreators.html b/docs/interfaces/_actions_normalize_.normalizeactioncreators.html index 531ae5e..eac22ac 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactioncreators.html +++ b/docs/interfaces/_actions_normalize_.normalizeactioncreators.html @@ -99,7 +99,9 @@

    Index

    Properties

    @@ -109,17 +111,61 @@

    Properties

    Properties

    +
    + +

    addChildData

    +
    addChildData: function
    + +
    +
    +

    Action creator for the AddChildData action

    +
    +
    +
    +

    Type declaration

    +
      +
    • +
        +
      • <C>(data: Array, childSchema: Entity, parentId: string): AddChildData<C>
      • +
      +
        +
      • +

        Type parameters

        +
          +
        • +

          C

          +
        • +
        +

        Parameters

        +
          +
        • +
          data: Array
          +
        • +
        • +
          childSchema: Entity
          +
        • +
        • +
          parentId: string
          +
        • +
        +

        Returns AddChildData<C>

        +
      • +
      +
    • +
    +
    +

    addData

    addData: function
    @@ -132,14 +178,14 @@

    Type declaration

      • Parameters

        • -
          data: T[]
          +
          data: Array

        Returns AddData<T>

        @@ -149,17 +195,55 @@

        Returns + +

        removeChildData

        +
        removeChildData: function
        + +
        +
        +

        Action creator for the AddChildData action

        +
        +
        +
        +

        Type declaration

        +
          +
        • + +
            +
          • +

            Parameters

            +
              +
            • +
              id: string
              +
            • +
            • +
              childSchema: Entity
              +
            • +
            • +
              parentId: string
              +
            • +
            +

            Returns RemoveChildData

            +
          • +
          +
        • +
        +
        +

    removeData

    removeData: function
    @@ -198,11 +282,7 @@

    setData

    setData: function
    @@ -215,14 +295,14 @@

    Type declaration

    diff --git a/docs/interfaces/_actions_normalize_.normalizeactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeactionpayload.html index 2aeb2d1..22fbdb9 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionpayload.html @@ -72,8 +72,7 @@

    Interface NormalizeActionPayload

    -

    Interface for a normalizer.normalize call - The result property is expected to be an array of strings

    +

    Interface for a normalize action payload

    @@ -82,6 +81,11 @@

    Hierarchy

    @@ -107,11 +111,7 @@

    entities

    entities: EntityMap
    @@ -126,11 +126,7 @@

    result

    result: string[]
    diff --git a/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html b/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html index ed5baf1..0da621a 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html @@ -72,7 +72,7 @@

    Interface NormalizeActionSchemaConfig

    -

    Base interface for AddData and RemoveData action payload.

    +

    Base interface for AddData, and RemoveData action payload.

    @@ -113,11 +113,7 @@

    schema

    schema: Entity
    diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html b/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html new file mode 100644 index 0000000..28b773d --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html @@ -0,0 +1,362 @@ + + + + + + NormalizeChildActionConfig | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeChildActionConfig<T>

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Interface for the payload of the AddChildData action.

    +
    +
    +
    +
    +

    Type parameters

    +
      +
    • +

      T

      +
    • +
    +
    +
    +

    Hierarchy

    + +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    childSchema

    +
    childSchema: Entity
    + +
    +
    +

    The schema of the child data to add

    +
    +
    +
    +
    + +

    data

    +
    data: T[]
    + +
    +
    +

    The array of entities which should be normalized and added to the store.

    +
    +
    +
    +
    + +

    parentId

    +
    parentId: string
    + +
    +
    +

    The id of the parent entity

    +
    +
    +
    +
    + +

    parentSchema

    +
    parentSchema: Entity
    + +
    +
    +

    Schema definition of the entity. Used for de-/ and normalizing given entities.

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html b/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html new file mode 100644 index 0000000..c05c287 --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html @@ -0,0 +1,329 @@ + + + + + + NormalizeChildActionConfigBase | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeChildActionConfigBase<T>

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Typed Interface for the config of the AddChildData action. + Holds an typed array of entities to be added to the store.

    +
    +
    +
    +
    +

    Type parameters

    +
      +
    • +

      T

      +
    • +
    +
    +
    +

    Hierarchy

    + +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    data

    +
    data: T[]
    + +
    +
    +

    The array of entities which should be normalized and added to the store.

    +
    +
    +
    +
    + +

    parentSchema

    +
    parentSchema: Entity
    + +
    +
    +

    Schema definition of the entity. Used for de-/ and normalizing given entities.

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html b/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html new file mode 100644 index 0000000..eb06346 --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html @@ -0,0 +1,373 @@ + + + + + + NormalizeChildActionPayload | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeChildActionPayload

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Interface for child data related actions

    +
    +
    +
    +
    +

    Hierarchy

    + +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    entities

    +
    entities: EntityMap
    + +
    +
    +

    The normalized entities mapped to their schema keys

    +
    +
    +
    +
    + +

    parentId

    +
    parentId: string
    + +
    +
    +

    The id of the parent entity

    +
    +
    +
    +
    + +

    parentProperty

    +
    parentProperty: string
    + +
    +
    +

    Key of the parent's property which holds the child references

    +
    +
    +
    +
    + +

    parentSchemaKey

    +
    parentSchemaKey: string
    + +
    +
    +

    Schema key of the parent's property

    +
    +
    +
    +
    + +

    result

    +
    result: string[]
    + +
    +
    +

    The original sorted id's as an array

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html b/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html new file mode 100644 index 0000000..713c59c --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html @@ -0,0 +1,298 @@ + + + + + + NormalizeChildActionSchemaConfig | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeChildActionSchemaConfig

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Base interface for AddChildDataandRemoveChildData` action payload.

    +
    +
    +
    +
    +

    Hierarchy

    + +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    parentSchema

    +
    parentSchema: Entity
    + +
    +
    +

    Schema definition of the entity. Used for de-/ and normalizing given entities.

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html index ed4053c..adb7073 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html @@ -113,11 +113,7 @@

    id

    id: string
    @@ -132,11 +128,7 @@

    Optional removeChildrenremoveChildren: SchemaMap

    @@ -153,11 +145,7 @@

    schema

    diff --git a/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html index 8ed668f..7d193ed 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html @@ -72,8 +72,7 @@

    Interface NormalizeRemoveActionPayload

    -

    Interface for a normalizer.normalize call - The result property is expected to be an array of strings

    +

    Interface for a remove action payload

    @@ -108,11 +107,7 @@

    id

    id: string
    @@ -127,11 +122,7 @@

    key

    key: string
    @@ -146,11 +137,7 @@

    removeChildren

    removeChildren: SchemaMap | null
    diff --git a/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html new file mode 100644 index 0000000..d1dfe76 --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html @@ -0,0 +1,354 @@ + + + + + + NormalizeRemoveChildActionConfig | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeRemoveChildActionConfig

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Interface for the payload of the RemoveData action. + Accepts an id and an optional removeChildren property.

    +
    +
    +
    +
    +

    Hierarchy

    + +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    childSchema

    +
    childSchema: Entity
    + +
    +
    +

    The schema of the child data to add

    +
    +
    +
    +
    + +

    id

    +
    id: string
    + +
    +
    +

    The id of the entity that should be removed

    +
    +
    +
    +
    + +

    parentId

    +
    parentId: string
    + +
    +
    +

    The id of the parent entity

    +
    +
    +
    +
    + +

    parentSchema

    +
    parentSchema: Entity
    + +
    +
    +

    Schema definition of the entity. Used for de-/ and normalizing given entities.

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html new file mode 100644 index 0000000..29afa0d --- /dev/null +++ b/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html @@ -0,0 +1,366 @@ + + + + + + NormalizeRemoveChildActionPayload | ngrx-normalizr + + + + + +
    +
    +
    +
    + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + + +
    +
    + Menu +
    +
    +
    +
    +
    +
    + +

    Interface NormalizeRemoveChildActionPayload

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Interface for the payload of the RemoveChildAction

    +
    +
    +
    +
    +

    Hierarchy

    +
      +
    • + NormalizeRemoveChildActionPayload +
    • +
    +
    +
    +

    Index

    +
    +
    +
    +

    Properties

    + +
    +
    +
    +
    +
    +

    Properties

    +
    + +

    childSchemaKey

    +
    childSchemaKey: string
    + +
    +
    +

    The key of the child schema

    +
    +
    +
    +
    + +

    id

    +
    id: string
    + +
    +
    +

    The id of the entity that should be removed

    +
    +
    +
    +
    + +

    parentId

    +
    parentId: string
    + +
    +
    +

    The id of the parent entity

    +
    +
    +
    +
    + +

    parentProperty

    +
    parentProperty: string
    + +
    +
    +

    Key of the parent's property which holds the child references

    +
    +
    +
    +
    + +

    parentSchemaKey

    +
    parentSchemaKey: string
    + +
    +
    +

    Schema key of the parent's property

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    Legend

    +
    +
      +
    • Module
    • +
    • Object literal
    • +
    • Variable
    • +
    • Function
    • +
    • Function with type parameter
    • +
    • Index signature
    • +
    • Type alias
    • +
    +
      +
    • Enumeration
    • +
    • Enumeration member
    • +
    • Property
    • +
    • Method
    • +
    +
      +
    • Interface
    • +
    • Interface with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Index signature
    • +
    +
      +
    • Class
    • +
    • Class with type parameter
    • +
    • Constructor
    • +
    • Property
    • +
    • Method
    • +
    • Accessor
    • +
    • Index signature
    • +
    +
      +
    • Inherited constructor
    • +
    • Inherited property
    • +
    • Inherited method
    • +
    • Inherited accessor
    • +
    +
      +
    • Protected property
    • +
    • Protected method
    • +
    • Protected accessor
    • +
    +
      +
    • Private property
    • +
    • Private method
    • +
    • Private accessor
    • +
    +
      +
    • Static property
    • +
    • Static method
    • +
    +
    +
    +
    +
    +

    Generated using TypeDoc

    +
    +
    + + + + \ No newline at end of file diff --git a/docs/interfaces/_actions_normalize_.schemamap.html b/docs/interfaces/_actions_normalize_.schemamap.html index 064d524..a7afdcb 100644 --- a/docs/interfaces/_actions_normalize_.schemamap.html +++ b/docs/interfaces/_actions_normalize_.schemamap.html @@ -121,12 +121,18 @@

    Indexable

    diff --git a/docs/interfaces/_reducers_normalize_.entitymap.html b/docs/interfaces/_reducers_normalize_.entitymap.html index 6640305..840b70c 100644 --- a/docs/interfaces/_reducers_normalize_.entitymap.html +++ b/docs/interfaces/_reducers_normalize_.entitymap.html @@ -174,6 +174,9 @@
    [id: getNormalizedState
  • +
  • + getParentReferences +
  • normalized
  • diff --git a/docs/interfaces/_reducers_normalize_.normalizedentitystate.html b/docs/interfaces/_reducers_normalize_.normalizedentitystate.html index 9d5adbd..bc2c84e 100644 --- a/docs/interfaces/_reducers_normalize_.normalizedentitystate.html +++ b/docs/interfaces/_reducers_normalize_.normalizedentitystate.html @@ -108,11 +108,7 @@

    entities

    entities: EntityMap
    @@ -128,11 +124,7 @@

    result

    result: string[]
    @@ -224,6 +216,9 @@

    result

  • getNormalizedState
  • +
  • + getParentReferences +
  • normalized
  • diff --git a/docs/interfaces/_reducers_normalize_.normalizedstate.html b/docs/interfaces/_reducers_normalize_.normalizedstate.html index c94484f..5c15e0c 100644 --- a/docs/interfaces/_reducers_normalize_.normalizedstate.html +++ b/docs/interfaces/_reducers_normalize_.normalizedstate.html @@ -106,11 +106,7 @@

    normalized

    @@ -197,6 +193,9 @@

    normalized

  • getNormalizedState
  • +
  • + getParentReferences +
  • normalized
  • diff --git a/docs/interfaces/_reducers_normalize_.schemaselectors.html b/docs/interfaces/_reducers_normalize_.schemaselectors.html index d0fd951..32ca35e 100644 --- a/docs/interfaces/_reducers_normalize_.schemaselectors.html +++ b/docs/interfaces/_reducers_normalize_.schemaselectors.html @@ -116,11 +116,7 @@

    entitiesProjector

    entitiesProjector: function
    @@ -151,11 +147,7 @@

    entityProjector

    entityProjector: function
    @@ -189,11 +181,7 @@

    getEntities

    getEntities: MemoizedSelector<__type, T[]>
    @@ -203,11 +191,7 @@

    getNormalizedEntities

    getNormalizedEntities: MemoizedSelector<any, EntityMap>
    @@ -298,6 +282,9 @@

    getNormalizedEntities

  • getNormalizedState
  • +
  • + getParentReferences +
  • normalized
  • diff --git a/docs/modules/_actions_normalize_.html b/docs/modules/_actions_normalize_.html index 3cf054a..379dd79 100644 --- a/docs/modules/_actions_normalize_.html +++ b/docs/modules/_actions_normalize_.html @@ -73,8 +73,10 @@

    Index

    Classes

    @@ -86,8 +88,14 @@

    Interfaces

  • NormalizeActionCreators
  • NormalizeActionPayload
  • NormalizeActionSchemaConfig
  • +
  • NormalizeChildActionConfig
  • +
  • NormalizeChildActionConfigBase
  • +
  • NormalizeChildActionPayload
  • +
  • NormalizeChildActionSchemaConfig
  • NormalizeRemoveActionConfig
  • NormalizeRemoveActionPayload
  • +
  • NormalizeRemoveChildActionConfig
  • +
  • NormalizeRemoveChildActionPayload
  • SchemaMap
  • @@ -101,6 +109,7 @@

    Variables

    Functions

    @@ -114,11 +123,7 @@

    ACTION_NAMESPACE

    ACTION_NAMESPACE: "[@@Normalize]" = "[@@Normalize]"
    @@ -140,11 +145,7 @@

    actionCreators

  • @@ -172,6 +173,43 @@

    Returns + +

    getRelationProperty

    +
      +
    • getRelationProperty(schema: Entity, childSchema: Entity): string
    • +
    +
      +
    • + +
      +
      +

      Return the parents property name the child schema is related to

      +
      +
      +

      Parameters

      +
        +
      • +
        schema: Entity
        +
        +

        The parent schema

        +
        +
      • +
      • +
        childSchema: Entity
        +
        +

        The child schema

        +
        +
      • +
      +

      Returns string

      +
    • +
    +
    diff --git a/docs/modules/_reducers_normalize_.html b/docs/modules/_reducers_normalize_.html index 351829c..bbfaab2 100644 --- a/docs/modules/_reducers_normalize_.html +++ b/docs/modules/_reducers_normalize_.html @@ -97,6 +97,7 @@

    Functions

  • createSchemaSelectors
  • createSingleDenormalizer
  • getNormalizedState
  • +
  • getParentReferences
  • normalized
  • @@ -117,11 +118,7 @@

    STATE_KEY

    STATE_KEY: "normalized" = "normalized"
    @@ -136,11 +133,7 @@

    getNormalizedEntities

    getNormalizedEntities: MemoizedSelector<any, EntityMap> = createSelector(getNormalizedState,(state: NormalizedEntityState) => state.entities)
    @@ -157,11 +150,7 @@

    getResult

    getResult: MemoizedSelector<any, string[]> = createSelector(getNormalizedState,(state: NormalizedEntityState) => state.result)
    @@ -183,11 +172,7 @@

    createEntitiesProjector

  • @@ -224,11 +209,7 @@

    createEntitiesSelector

  • @@ -265,11 +246,7 @@

    createEntityProjector

  • @@ -306,11 +283,7 @@

    createMultipleDenormalizer

  • @@ -341,11 +314,7 @@

    createSchemaSelectors

  • @@ -382,7 +351,7 @@

    createSingleDenormalizer

  • @@ -413,11 +382,7 @@

    getNormalizedState

  • @@ -440,6 +405,43 @@

    Returns + +

    Private getParentReferences

    + + +

    normalized

    @@ -450,11 +452,7 @@

    normalized

  • @@ -509,11 +507,7 @@

    initialState

    initialState: object
    @@ -527,11 +521,7 @@

    entities

    entities: object
    @@ -546,11 +536,7 @@

    result

    result: undefined[] = []
  • @@ -624,6 +610,9 @@

    result

  • getNormalizedState
  • +
  • + getParentReferences +
  • normalized
  • From d4d35bc6938d7693026cf8aca394080307c17ebd Mon Sep 17 00:00:00 2001 From: michaelkrone Date: Sun, 19 Nov 2017 22:34:14 +0100 Subject: [PATCH 23/26] chore(bump): 2.2.0 --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 00f4c5a..45b4926 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngrx-normalizr", - "version": "2.1.0", + "version": "2.2.0", "description": "Normalizing state reducer for ngrx applications", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -9,7 +9,8 @@ "prepublishOnly": "yarn aot", "tsc": "rm -rf ./dist && tsc", "aot": "rm -rf ./dist && ./node_modules/.bin/ngc", - "docs": "rm -rf ./docs && typedoc --out ./docs --name ngrx-normalizr --readme ./README.md --module commonjs --target ES5 --theme default && yarn docs-github", + "docs": + "rm -rf ./docs && typedoc --out ./docs --name ngrx-normalizr --readme ./README.md --module commonjs --target ES5 --theme default && yarn docs-github", "docs-github": "touch ./docs/.nojekyll", "test": "./node_modules/.bin/karma start karma-ci.conf.js" }, From dace66175a7bfcadcddb545ce3df41b32562f300 Mon Sep 17 00:00:00 2001 From: michaelkrone Date: Sun, 19 Nov 2017 22:36:35 +0100 Subject: [PATCH 24/26] docs(2.2.0): fix parameter use for removing childs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5aa6eca..60d937e 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ removePetEffect$ = this.actions$ .switchMap(action => this.http.remove(`https://example.com/api/pets/${action.payload.id}`)) .mergeMap((data: Pet) => [ // dispatch to add data to the store - new RemoveChildData({ id: data.id, childSchema, parentId }), + new RemoveChildData({ id: data.id, childSchema, parentSchema, parentId }), // dispatch to inform feature reducer new RemovePetSuccess(data) ]) From 0097900f0e9b55a71050cb47be159a9b0b5b611f Mon Sep 17 00:00:00 2001 From: michaelkrone Date: Sun, 19 Nov 2017 22:37:26 +0100 Subject: [PATCH 25/26] docs(2.2.0): update parameter documentation --- .../_actions_normalize_.addchilddata.html | 6 ++-- docs/classes/_actions_normalize_.adddata.html | 6 ++-- ...tions_normalize_.normalizeactiontypes.html | 10 +++---- .../_actions_normalize_.removechilddata.html | 6 ++-- .../_actions_normalize_.removedata.html | 6 ++-- docs/classes/_actions_normalize_.setdata.html | 6 ++-- docs/index.html | 2 +- ...ions_normalize_.normalizeactionconfig.html | 4 +-- ...ns_normalize_.normalizeactioncreators.html | 10 +++---- ...ons_normalize_.normalizeactionpayload.html | 4 +-- ...ormalize_.normalizeactionschemaconfig.html | 2 +- ...normalize_.normalizechildactionconfig.html | 8 ++--- ...alize_.normalizechildactionconfigbase.html | 4 +-- ...ormalize_.normalizechildactionpayload.html | 10 +++---- ...ize_.normalizechildactionschemaconfig.html | 2 +- ...ormalize_.normalizeremoveactionconfig.html | 6 ++-- ...rmalize_.normalizeremoveactionpayload.html | 6 ++-- ...ize_.normalizeremovechildactionconfig.html | 8 ++--- ...ze_.normalizeremovechildactionpayload.html | 10 +++---- ...cers_normalize_.normalizedentitystate.html | 4 +-- .../_reducers_normalize_.normalizedstate.html | 2 +- .../_reducers_normalize_.schemaselectors.html | 8 ++--- docs/modules/_actions_normalize_.html | 6 ++-- docs/modules/_reducers_normalize_.html | 30 +++++++++---------- 24 files changed, 83 insertions(+), 83 deletions(-) diff --git a/docs/classes/_actions_normalize_.addchilddata.html b/docs/classes/_actions_normalize_.addchilddata.html index a4e82be..71162dd 100644 --- a/docs/classes/_actions_normalize_.addchilddata.html +++ b/docs/classes/_actions_normalize_.addchilddata.html @@ -131,7 +131,7 @@

    constructor

  • @@ -163,7 +163,7 @@

    payload

    @@ -179,7 +179,7 @@

    type

    type: string = NormalizeActionTypes.ADD_CHILD_DATA
    diff --git a/docs/classes/_actions_normalize_.adddata.html b/docs/classes/_actions_normalize_.adddata.html index 99e4a59..6440a1e 100644 --- a/docs/classes/_actions_normalize_.adddata.html +++ b/docs/classes/_actions_normalize_.adddata.html @@ -131,7 +131,7 @@

    constructor

  • @@ -163,7 +163,7 @@

    payload

    @@ -179,7 +179,7 @@

    type

    type: string = NormalizeActionTypes.ADD_DATA
    diff --git a/docs/classes/_actions_normalize_.normalizeactiontypes.html b/docs/classes/_actions_normalize_.normalizeactiontypes.html index d627f72..0fb71c1 100644 --- a/docs/classes/_actions_normalize_.normalizeactiontypes.html +++ b/docs/classes/_actions_normalize_.normalizeactiontypes.html @@ -109,7 +109,7 @@

    Static ADD_CHILD_DATA<
    ADD_CHILD_DATA: string = `${ACTION_NAMESPACE} Add Child Data`
    @@ -124,7 +124,7 @@

    Static ADD_DATA

    ADD_DATA: string = `${ACTION_NAMESPACE} Add Data`
    @@ -139,7 +139,7 @@

    Static REMOVE_CHILD_DA
    REMOVE_CHILD_DATA: string = `${ACTION_NAMESPACE} Remove Child Data`
    @@ -154,7 +154,7 @@

    Static REMOVE_DATA

    REMOVE_DATA: string = `${ACTION_NAMESPACE} Remove Data`
    @@ -169,7 +169,7 @@

    Static SET_DATA

    SET_DATA: string = `${ACTION_NAMESPACE} Set Data`
    diff --git a/docs/classes/_actions_normalize_.removechilddata.html b/docs/classes/_actions_normalize_.removechilddata.html index 84af763..14b83c0 100644 --- a/docs/classes/_actions_normalize_.removechilddata.html +++ b/docs/classes/_actions_normalize_.removechilddata.html @@ -123,7 +123,7 @@

    constructor

  • @@ -150,7 +150,7 @@

    payload

    @@ -166,7 +166,7 @@

    type

    type: string = NormalizeActionTypes.REMOVE_CHILD_DATA
    diff --git a/docs/classes/_actions_normalize_.removedata.html b/docs/classes/_actions_normalize_.removedata.html index 408dbbd..6c71763 100644 --- a/docs/classes/_actions_normalize_.removedata.html +++ b/docs/classes/_actions_normalize_.removedata.html @@ -123,7 +123,7 @@

    constructor

  • @@ -150,7 +150,7 @@

    payload

    @@ -166,7 +166,7 @@

    type

    type: string = NormalizeActionTypes.REMOVE_DATA
    diff --git a/docs/classes/_actions_normalize_.setdata.html b/docs/classes/_actions_normalize_.setdata.html index 0b2864d..029acf2 100644 --- a/docs/classes/_actions_normalize_.setdata.html +++ b/docs/classes/_actions_normalize_.setdata.html @@ -131,7 +131,7 @@

    constructor

  • @@ -163,7 +163,7 @@

    payload

    @@ -179,7 +179,7 @@

    type

    type: string = NormalizeActionTypes.SET_DATA
    diff --git a/docs/index.html b/docs/index.html index 368c260..b376b0c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -200,7 +200,7 @@
    Using AddChildData in an e .switchMap(action => this.http.remove(`https://example.com/api/pets/${action.payload.id}`)) .mergeMap((data: Pet) => [ // dispatch to add data to the store - new RemoveChildData({ id: data.id, childSchema, parentId }), + new RemoveChildData({ id: data.id, childSchema, parentSchema, parentId }), // dispatch to inform feature reducer new RemovePetSuccess(data) ]) diff --git a/docs/interfaces/_actions_normalize_.normalizeactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeactionconfig.html index 9a6ec7c..2be67f7 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionconfig.html @@ -120,7 +120,7 @@

    data

    data: T[]
    @@ -136,7 +136,7 @@

    schema

    diff --git a/docs/interfaces/_actions_normalize_.normalizeactioncreators.html b/docs/interfaces/_actions_normalize_.normalizeactioncreators.html index eac22ac..01242c2 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactioncreators.html +++ b/docs/interfaces/_actions_normalize_.normalizeactioncreators.html @@ -117,7 +117,7 @@

    addChildData

    addChildData: function
    @@ -165,7 +165,7 @@

    addData

    addData: function
    @@ -201,7 +201,7 @@

    removeChildData

    removeChildData: function
    @@ -243,7 +243,7 @@

    removeData

    removeData: function
    @@ -282,7 +282,7 @@

    setData

    setData: function
    diff --git a/docs/interfaces/_actions_normalize_.normalizeactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeactionpayload.html index 22fbdb9..e87c466 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionpayload.html @@ -111,7 +111,7 @@

    entities

    entities: EntityMap
    @@ -126,7 +126,7 @@

    result

    result: string[]
    diff --git a/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html b/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html index 0da621a..df18b4e 100644 --- a/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeactionschemaconfig.html @@ -113,7 +113,7 @@

    schema

    schema: Entity
    diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html b/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html index 28b773d..99d66c2 100644 --- a/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizechildactionconfig.html @@ -121,7 +121,7 @@

    childSchema

    childSchema: Entity
    @@ -137,7 +137,7 @@

    data

    @@ -152,7 +152,7 @@

    parentId

    parentId: string
    @@ -168,7 +168,7 @@

    parentSchema

    diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html b/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html index c05c287..e33e004 100644 --- a/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html +++ b/docs/interfaces/_actions_normalize_.normalizechildactionconfigbase.html @@ -125,7 +125,7 @@

    data

    data: T[]
    @@ -141,7 +141,7 @@

    parentSchema

    diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html b/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html index eb06346..9b83aad 100644 --- a/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizechildactionpayload.html @@ -115,7 +115,7 @@

    entities

    @@ -130,7 +130,7 @@

    parentId

    parentId: string
    @@ -145,7 +145,7 @@

    parentProperty

    parentProperty: string
    @@ -160,7 +160,7 @@

    parentSchemaKey

    parentSchemaKey: string
    @@ -176,7 +176,7 @@

    result

    diff --git a/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html b/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html index 713c59c..06c2e28 100644 --- a/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizechildactionschemaconfig.html @@ -113,7 +113,7 @@

    parentSchema

    parentSchema: Entity
    diff --git a/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html index adb7073..a04682a 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeremoveactionconfig.html @@ -113,7 +113,7 @@

    id

    id: string
    @@ -128,7 +128,7 @@

    Optional removeChildrenremoveChildren: SchemaMap

    @@ -145,7 +145,7 @@

    schema

    diff --git a/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html index 7d193ed..d53dd83 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizeremoveactionpayload.html @@ -107,7 +107,7 @@

    id

    id: string
    @@ -122,7 +122,7 @@

    key

    key: string
    @@ -137,7 +137,7 @@

    removeChildren

    removeChildren: SchemaMap | null
    diff --git a/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html b/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html index d1dfe76..5a4af24 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html +++ b/docs/interfaces/_actions_normalize_.normalizeremovechildactionconfig.html @@ -114,7 +114,7 @@

    childSchema

    childSchema: Entity
    @@ -129,7 +129,7 @@

    id

    id: string
    @@ -144,7 +144,7 @@

    parentId

    parentId: string
    @@ -160,7 +160,7 @@

    parentSchema

    diff --git a/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html b/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html index 29afa0d..24434a2 100644 --- a/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html +++ b/docs/interfaces/_actions_normalize_.normalizeremovechildactionpayload.html @@ -109,7 +109,7 @@

    childSchemaKey

    childSchemaKey: string
    @@ -124,7 +124,7 @@

    id

    id: string
    @@ -139,7 +139,7 @@

    parentId

    parentId: string
    @@ -154,7 +154,7 @@

    parentProperty

    parentProperty: string
    @@ -169,7 +169,7 @@

    parentSchemaKey

    parentSchemaKey: string
    diff --git a/docs/interfaces/_reducers_normalize_.normalizedentitystate.html b/docs/interfaces/_reducers_normalize_.normalizedentitystate.html index bc2c84e..6571a5e 100644 --- a/docs/interfaces/_reducers_normalize_.normalizedentitystate.html +++ b/docs/interfaces/_reducers_normalize_.normalizedentitystate.html @@ -108,7 +108,7 @@

    entities

    entities: EntityMap
    @@ -124,7 +124,7 @@

    result

    result: string[]
    diff --git a/docs/interfaces/_reducers_normalize_.normalizedstate.html b/docs/interfaces/_reducers_normalize_.normalizedstate.html index 5c15e0c..c306b6a 100644 --- a/docs/interfaces/_reducers_normalize_.normalizedstate.html +++ b/docs/interfaces/_reducers_normalize_.normalizedstate.html @@ -106,7 +106,7 @@

    normalized

    diff --git a/docs/interfaces/_reducers_normalize_.schemaselectors.html b/docs/interfaces/_reducers_normalize_.schemaselectors.html index 32ca35e..72c64b8 100644 --- a/docs/interfaces/_reducers_normalize_.schemaselectors.html +++ b/docs/interfaces/_reducers_normalize_.schemaselectors.html @@ -116,7 +116,7 @@

    entitiesProjector

    entitiesProjector: function
    @@ -147,7 +147,7 @@

    entityProjector

    entityProjector: function
    @@ -181,7 +181,7 @@

    getEntities

    getEntities: MemoizedSelector<__type, T[]>
    @@ -191,7 +191,7 @@

    getNormalizedEntities

    getNormalizedEntities: MemoizedSelector<any, EntityMap>
    diff --git a/docs/modules/_actions_normalize_.html b/docs/modules/_actions_normalize_.html index 379dd79..e339e64 100644 --- a/docs/modules/_actions_normalize_.html +++ b/docs/modules/_actions_normalize_.html @@ -123,7 +123,7 @@

    ACTION_NAMESPACE

    ACTION_NAMESPACE: "[@@Normalize]" = "[@@Normalize]"
    @@ -145,7 +145,7 @@

    actionCreators

  • @@ -183,7 +183,7 @@

    getRelationProperty

  • diff --git a/docs/modules/_reducers_normalize_.html b/docs/modules/_reducers_normalize_.html index bbfaab2..c7b7403 100644 --- a/docs/modules/_reducers_normalize_.html +++ b/docs/modules/_reducers_normalize_.html @@ -118,7 +118,7 @@

    STATE_KEY

    STATE_KEY: "normalized" = "normalized"
    @@ -133,7 +133,7 @@

    getNormalizedEntities

    getNormalizedEntities: MemoizedSelector<any, EntityMap> = createSelector(getNormalizedState,(state: NormalizedEntityState) => state.entities)
    @@ -150,7 +150,7 @@

    getResult

    getResult: MemoizedSelector<any, string[]> = createSelector(getNormalizedState,(state: NormalizedEntityState) => state.result)
    @@ -172,7 +172,7 @@

    createEntitiesProjector

  • @@ -209,7 +209,7 @@

    createEntitiesSelector

  • @@ -246,7 +246,7 @@

    createEntityProjector

  • @@ -283,7 +283,7 @@

    createMultipleDenormalizer

  • @@ -314,7 +314,7 @@

    createSchemaSelectors

  • @@ -351,7 +351,7 @@

    createSingleDenormalizer

  • @@ -382,7 +382,7 @@

    getNormalizedState

  • @@ -415,7 +415,7 @@

    Private getParentRefe
  • @@ -452,7 +452,7 @@

    normalized

  • @@ -507,7 +507,7 @@

    initialState

    initialState: object
    @@ -521,7 +521,7 @@

    entities

    entities: object
    @@ -536,7 +536,7 @@

    result

    result: undefined[] = []
    From a42a5ffb3596b8df69bdd025020e2246b759b7b8 Mon Sep 17 00:00:00 2001 From: michaelkrone Date: Sun, 19 Nov 2017 22:47:04 +0100 Subject: [PATCH 26/26] docs(README): add npm version doc note --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60d937e..7cdce90 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@ > Managing [normalized state](https://redux.js.org/docs/recipes/reducers/NormalizingStateShape.html) in [ngrx](https://github.com/ngrx/platform) applications, transparently. - This package provides a set of actions, reducers and selectors for handling normalization and denormalization of state data **transparently**. *ngrx-normalizr* uses [normalizr](https://github.com/paularmstrong/normalizr) for [normalizing](https://github.com/paularmstrong/normalizr/blob/master/docs/api.md#normalizedata-schema) and [denormalizing](https://github.com/paularmstrong/normalizr/blob/master/docs/api.md#denormalizeinput-schema-entities) data. All normalization and denormalization is defined by the use of [normalizr schemas](https://github.com/paularmstrong/normalizr/blob/master/docs/api.md#schema), since that's the way normalizr works. This enables selectors to use a transparent and powerful projection of state data. +> Releases will be published from the [`master`](https://github.com/michaelkrone/ngrx-normalizr/tree/master) branch. [Go there](https://github.com/michaelkrone/ngrx-normalizr/tree/master) for documentation that aligns with the npm repo version. + ## Installation To install this package: ```sh