You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,11 @@
1
+
*_2.0.0_
2
+
* Serialization support for actions. _Details:_ The normalization of entities is now perfomed in the action constructor. Previously it was handled by the reducer. As ([@PachowStudios](https://github.com/PachowStudios)) pointed out in Issue #16, ngrx-normalizr actions were not serializable. This could raise issues with other redux/ngrx libraries. The normalizr `schema.Entity` is not part of the action payload anymore, hence the interfaces for describing the payload have changed and the action constructor does no longer take the payload itself as an argument. As long as you did not type any action parameters in your code or dispatched actions directly with a simle pojo by using the exported action type names, you should have no problem updating, since the arity/keys of the constructor API did not change - see Breaking Changes. (Closes #16)
3
+
4
+
***Breaking Changes**
5
+
* Action constructor parameters changed from `NormalizeDataPayload` to `NormalizeActionConfig` and from `NormalizeRemovePayload` to `NormalizeRemoveActionConfig`
6
+
* Action `payload` property types changed from `NormalizeDataPayload` to `NormalizeActionPayload` and from `NormalizeRemovePayload` to `NormalizeRemoveActionPayload`
7
+
* (might break) Internal used interface `SchemaPayload` replaced by `NormalizeActionSchemaConfig`
Actions are used to set data in - and remove data from - the normalized store.
81
81
82
82
### Adding data
83
-
To add data and automatically normalize it, *ngrx-normalizr* provides a `AddData` action. This action takes an object with `data` and `schema` as a payload. Entities are identified by their id attribute set in the passed schema.
83
+
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.
84
84
Existing entities will be overwritten by updated data, new entities will be added to the store.
85
85
86
86
###### Using `AddData` in an effect
@@ -99,19 +99,19 @@ loadEffect$ = this.actions$
99
99
```
100
100
101
101
### Setting data
102
-
The `SetData` action will overwrite all entities for a given schema with the normalized entities of the `data` property of the action payload. This action can
102
+
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
103
103
be used for resetting entity state data instead of adding and updating existing entities.
104
104
105
105
### Removing data
106
106
To remove data, *ngrx-normalizr* provides a `RemoveData` action.
107
-
This action takes an object with `id`, `schema` and an optional `removeChildren` property as payload. The schema entity with the given id will be removed. If `removeChildren` is a map of the schema key mapped to an object property, all referenced child entities will also be removed from the store. This is handy for 1:1 relations, since only removing the parent entity may leave unused child entities in the store.
107
+
This action takes an object with `id`, `schema` and an optional `removeChildren` property as constructor argument. The schema entity with the given id will be removed. If `removeChildren` is a map of the schema key mapped to an object property, all referenced child entities will also be removed from the store. This is handy for 1:1 relations, since only removing the parent entity may leave unused child entities in the store.
0 commit comments