p5.js-web-editor/shared/redux/store/configureStore.js
2016-05-05 17:48:26 -04:00

20 lines
No EOL
501 B
JavaScript

import { createStore, applyMiddleware } from 'redux'
import rootReducer from '../reducers'
export default function configureStore(initialState) {
const store = createStore(
rootReducer,
initialState
// applyMiddleware(thunk)
)
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers', () => {
const nextRootReducer = require('../reducers').default
store.replaceReducer(nextRootReducer)
})
}
return store
}