Releases: reduxjs/redux
Releases · reduxjs/redux
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
- For Browserify users, Redux should now be properly envified without extra configuration (#1301)
createStore()
now receives an enhancer such asapplyMiddleware()
as the last optional argument (#1294)
Wait, what?
You don’t have to change anything. However if you use store enhancers such as applyMiddleware()
or Redux DevTools you might like that you can now express the same code in a more JavaScript-friendly way:
- const createStoreWithMiddleware = applyMiddleware(
- thunk,
- logger
- )(createStore)
- const store = createStoreWithMiddleware(
- rootReducer,
- initialState
- )
+ const store = createStore(
+ rootReducer,
+ initialState,
+ applyMiddleware(thunk, logger)
+ )
For multiple store enhancers you can still use compose()
but in a similar more straightforward fashion:
- const finalCreateStore = compose(
- applyMiddleware(thunk, logger),
- DevTools.instrument()
- )(createStore)
- const store = finalCreateStore(reducer, initialState)
+ const store = createStore(
+ reducer,
+ initialState,
+ compose(
+ applyMiddleware(thunk, logger),
+ DevTools.instrument()
+ )
+ )
The second initialState
argument stays optional so you can skip it when specifying the enhancer.
The old way of doing things still works, too.
We’re just adding a nicer way to apply enhancers, that’s all.
Happy reducing!
v3.0.6
compose()
now aligns more closely with Underscore/Lodash behavior by allowing multiple arguments to be passed to the last function. This is not changing the existing behavior for the single argument call which has been the only possible use case before. (#632 (comment), #1050)- The dev-only state shape sanity check warning in
combineReducers()
now runs faster. (#1118) - Now we warn if you’re running an unenvified build of Redux in production as it is slower. We determine this by checking whether you have uglified Redux code, and if you did, we check that
process.env.NODE_ENV
polyfill (which we require anyway) is set to'production'
. This does not affect the UMD builds. This is also a warning and not a hard error so it isn't a breaking change. (#1029, #1075) - We now officially support importing individual modules from
redux/lib/*.js
. This is only true for top-level directory—we do not supporting reaching intoredux/lib/utils
, for example. To support this, we moved all top-level exports to be inredux/lib
, for example,redux/lib/applyMiddleware.js
. (#1223, #1224)