ngrx-store-localstorage doesn't play well with createFeature #268
Labels
feature stores
Functionality related to feature stores / modules
known workaround
There is a known workaround for this issue
I'm using NGRX's
createFeature
for some of my store feature slices. However, when I use ngrx-store-localstorage to save anything from those feature slices, the merge reducer overwrites my initial state from that feature with rehydrated object, resulting in my feature not having aninitialState
. I didn't deep dive enough, but I think the reason is that feature modules are added to the store a bit later that the first@ngrx/store/init action
runs.I've created a workaround by defining my own merge reducer that skips rehydrated state's top level keys if they're not in the store yet.
The text was updated successfully, but these errors were encountered: