MENU
configureStore
Building on createStore(), configureStore():
- accepts a readable named options object, with the keys 'preloadedState', 'reducer', 'middleware', 'enhancers', and 'devTools'.
- accepts arrays of middleware and enhancers by calling applyMiddleware() and compose() automatically.
- can call combineReducers() automatically.
- enables Redux DevTools Extension automatically by default.
- adds the 'redux-thunk' middleware automatically.
- adds middleware that check for common mistakes like mutating the state or using non-serializable values in development.
...no more applyMiddleware() and compose()!
The default middleware is not included if you explicitly state a value for the 'middleware' key. Assign a callback accepting a defaultMiddleware argument if you want to add to the default middleware.
...no more combineReducers()!
If you want to nest reducers to more than one levels, you'll still need to call combineReducers().
enhancers: [offline] will result in a final setup of [applyMiddleware, offline, devToolsExtension].
enhancers: (defaultEnhancers) => [offline, ...defaultEnhancers] will result in a final setup of [offline, applyMiddleware, devToolsExtension].