michaelkrone / ngrx-normalizr

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

Feature and Root normalized state #37

Open cam-m opened 6 years ago

cam-m commented 6 years ago

Hi,

I've an existing app using your library with the normalized reducer in the root app module. I'm now trying to add normalized state to a feature module, while also keeping the root normalized state.

To enable the normalizing reducer to store normalized data, you have to add it to your state. The best place for this might be the root state of your application, but feature states may use their own normalized state as well.

My feature module's state extends NormalizedState and I've added the normalized reducer to my reducer map.

How do I ensure that the schema bound actions are only picked up in the feature state? At the moment both the root and the feature normalized reducers are handling schema bound actions, resulting in duplicated state in the store.

Thanks!

Cam