-
Notifications
You must be signed in to change notification settings - Fork 592
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
Using with Immutable.js #22
Comments
I never try with |
I was playing around with Immutable.js this weekend so I decided to give this a try. You can see an example of how this would work w/ Immutable in my fork: https://github.com/ecozoic/connected-react-router/pull/1/files These changes assume your entire state object is an Immutable iterable (so if you use This is just a POC, to do something for real we would want this to be configurable somehow. Primary changes are in the ConnectedRouter where we read values from the store and in the connectRouter/routerReducer where we actually update state. Could maybe provide an "immutable" option on the router/middleware or more generally allow consumers to pass in some functions as props/arguments to customize behavior. |
Thanks @ecozoic. I understand it now. I may provide I'm not sure how often people use other ways to select value from the state object. So, I may provide an option to specify selector function in the future if there are several requests on this feature. |
I had made my own fork of this project supporting ImmutableJS, but it would be kind of stupid to make a separate PR when @ecozoic works wonders already! Great work. I was wondering what the best API would be if you would support Immutable out of the box? One example is
It uses a factory function to create the correct type. Maybe the same principle can be used here? |
@nickwaelkens I like the way |
Hi all, I've made it support Just import See more details here. |
Great work @supasate. Will try this out soon but looks good! |
Yes thanks so much @supasate ! Adding this to my react-starter and it seems to be working great! EDIT - here's a PR w/ changes to support it. super easy! |
@ecozoic Cool! Great to know it works for you! |
Does this library support using Immutable.js with Redux?
If not, it would be nice to add it.
The text was updated successfully, but these errors were encountered: