Closed jeroenbourgois closed 8 years ago
const enhancer = compose(
autoRehydrate(),
//...
persistStore(store)
otherwise you will not get any persistence :)Let me know if that works! Also what is the error you were seeing? It would be cool if there is some way to detect autoRehydrate is being used in this way, e.g. we could possibly check if the arguments look like enhancer arguments and if so warn.
Aha that was it! I blindly followed the docs, let me PR that!
I will keep an eye on the Immutablejs discussion, since I use it throughout my reducers and see that a plain js object is returned (what is the behaviour now, which is fine!)
if you are using immutable I would strongly consider using https://github.com/rt2zz/redux-persist-transform-immutable which uses transit to automatically handle immutable objects.
I already did :) it is integrated + working
When using the enhancer like in the docs, the creation of my store fails. However if I omit the
autoRehydrate
it seems to work. Is it an error in the docs or am I doing something wrong?Here is my full 'configureStore' file: