michaelkrone / ngrx-normalizr

Managing normalized state in ngrx applications - transparently
https://michaelkrone.github.io/ngrx-normalizr/
MIT License
50 stars 17 forks source link

Schemas break the rule of actions being serializable #16

Closed shayded-exe closed 6 years ago

shayded-exe commented 6 years ago

Normalizr's schema objects aren't serializable.

Instead of having the action hang on to the schema and doing the normalization in the reducer, the normalization should be done in the action's constructor (just like a classic action creator) which then puts the normalized entities in the action's payload. That way, the action is completely serializable at the time it's dispatched.

michaelkrone commented 6 years ago

Hello @PachowStudios Your point is absolutely valid, I just did not think of this. I will look into this.

michaelkrone commented 6 years ago

As far as I see, the API can stay unchanged, but the interfaces are changing, so this will be a v2.0.0 release.

shayded-exe commented 6 years ago

Awesome! Thanks for taking care of it