-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to serialise #4
Comments
Good catch. It seems the most elegant solution is for redux-persist's |
A little bit better solution is writing your own serializer and deserializer:
Or we could modify redux-persist-crosstab to support serialization/deserialization:
First one looks uglier but the latter one can hurt the performance :( So probably the best would be having support in redux-persist for rehydrating serialized data. |
I'm getting errors using this with
redux-persist
2.0 aspersistor.rehydrate
is being passed an object instead of a string, which causes the deserialise function to die. My workaround has been to parse the newValue value, then stringify the whole statePartial object:statePartial[keyspace] = JSON.parse(e.newValue); persistor.rehydrate(JSON.stringify(statePartial), function(){ //@TODO handle errors? })
The text was updated successfully, but these errors were encountered: