You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v3.0.0: immutable.js support, small breaking changes in action exports
BREAKING CHANGE: redux-actions upgraded to 0.10.x, action types are now embedded into the action creators. This could potentially break your app if you relied
on actions used by redux-connect in your own reducers. Please use action creators directly as action names as they are embedded inside them. Read more on the
redux-actions repository.
Feat: adds support for Immutable.JS, curtesy of @toddbluhm. Read more in the README updates
Small outline:
* Added ability to use immutable stores with this lib
* Added global methods for converting from mutable to immutable and back again
* Added special method for controlling when the ReduxAsyncConnect component re-syncs with the server
* Simplify the reducer portion to just wrap the original reducer
* Export the immutable reducer as a separate reducer
* Updated docs to reflect new immutable reducer export
This lib can be used with ImmutableJS or any other immutability lib by providing methods that convert the state between mutable and immutable data. Along with those methods, there is also a special immutable reducer that needs to be used instead of the normal reducer.
// Thats all, now just use redux-connect as normal
160
+
exportconstrootReducer=combineReducers({
161
+
reduxAsyncConnect,
162
+
...
163
+
})
164
+
```
165
+
166
+
**React Router Issue**
167
+
168
+
While using the above immutablejs solution, an issue arose causing infinite recursion after firing
169
+
off a react standard action. The recursion was caused because the `componentWillReceiveProps` method will attempt to resync with the server. Thus `componentWillReceiveProps -> resync with server -> changes props via reducer -> componentWillReceiveProps`
170
+
171
+
The solution was to only resync with server on route changes. A `reloadOnPropsChange` prop is expose on the ReduxAsyncConnect component to allow customization of when a resync to the server should occur.
0 commit comments