-
Notifications
You must be signed in to change notification settings - Fork 397
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
Use an Immutable store #78
Comments
If you only want to use Immutable object in the redux offline, passing transforms to persistOptions is a good enough solution. But it will be great if we can detect to use Immutable transit by passing options and works with immutable store.
|
I created a PR #99 for this very same issue |
PR is now merged in master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be great if this library could work with Immutable.js stores, and I think it's a good idea to start talking about it in this issue.
I'm already using this library with an Immutable store and opened PR #54, but it only works with redux-offline v1.
To accept an Immutable store using my approach you only needed to set
config.immutable = true
. To achieve this, the only thing I needed was to teach redux-offline how to persist and rehydrate Immutable object. Luckilyredux-persist-immutable
makes this super easy, so I added it as a dependency.Implementing this was straightforward: The key parts were using a different persistStore and autoRehydrate in
index.js
, and converting the user's state to javascript inmiddleware.js
so that redux-offline internals can still work with plain JS objects.Please let me know of better ways to tackle this problem. Supporting Immutable stores would be great!
The text was updated successfully, but these errors were encountered: