Open jhen0409 opened 8 years ago
Firstly I agree, we should handle non-immutable state. As you mentioned this should be as simple as checking isIterable() in a couple of places in our operators.
Secondly, I am a bit confused that you are receiving that error. This module only checks top level state, and the shape of the state of your sub-reducers (react-router-redux for example) should not have any bad interactions. Can you double check that your top level state is an immutablejs Map, or clarify if i misunderstand something?
This module only checks top level state, and the shape of the state of your sub-reducers (react-router-redux for example) should not have any bad interactions.
Yes, sorry, I misunderstood. 😂
Can you double check that your top level state is an immutablejs Map
My top level state isn't an immutablejs Map, I just used it in sub-state, that's work with old version redux-persist-immutable
.
Ah yes, I wish we had a better naming scheme around this. You probably want https://github.com/rt2zz/redux-persist-transform-immutable plugged in to vanilla redux-persist. In the near future I will add non-immutable top level state support to this project which I think should help alleviate some of the confusion.
I have some non-immutable object in state (like routerReducer of
react-router-redux
), when I usingredux-persist-immutable
, it will throwstate.forEach is not function
error. I think we should useIterable.isIterable()
to check state areImmutable
.