(initialState={})
| 20 | } |
| 21 | |
| 22 | export default function configureStore(initialState={}) { |
| 23 | const store = createStore(rootReducer, initialState,storeEnhancers); |
| 24 | sagaMiddleware.run(rootSaga); |
| 25 | if (module.hot && process.env.NODE_ENV!=='production') { |
| 26 | // Enable Webpack hot module replacement for reducers |
| 27 | module.hot.accept( './reducers',() => { |
| 28 | const nextRootReducer = require('./reducers/index'); |
| 29 | store.replaceReducer(nextRootReducer); |
| 30 | }); |
| 31 | } |
| 32 | return store; |
| 33 | } |