| Total Complexity | 3 |
| Complexity/F | 1.5 |
| Lines of Code | 22 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 3 |
| 1 | import { compose, createStore, applyMiddleware } from 'redux'; |
||
| 2 | import rootReducer from '../reducers'; |
||
| 3 | import thunk from 'redux-thunk'; |
||
| 4 | |||
| 5 | const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; |
||
| 6 | |||
| 7 | export default function configureStore(initialState) { |
||
| 8 | const store = createStore(rootReducer, initialState, composeEnhancers( |
||
| 9 | applyMiddleware( |
||
| 10 | thunk |
||
| 11 | ) |
||
| 12 | )); |
||
| 13 | |||
| 14 | if (module.hot) { |
||
| 15 | module.hot.accept('../reducers', () => { |
||
| 16 | const nextReducer = require('../reducers'); |
||
| 17 | store.replaceReducer(nextReducer); |
||
| 18 | }); |
||
| 19 | } |
||
| 20 | |||
| 21 | return store; |
||
| 22 | } |
||
| 23 |