Solstice web interface.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
842 B

//This file merely configures the store for hot reloading.
//This boilerplate file is likely to be the same for each project that uses Redux.
//With Redux, the actual stores are in /reducers.
import { createStore } from 'redux';
import rootReducer from '../reducers';
export default function configureStore(initialState) {
let store;
if (window.devToolsExtension) { //Enable Redux devtools if the extension is installed in developer's browser
store = window.devToolsExtension()(createStore)(rootReducer, initialState);
} else {
store = createStore(rootReducer, initialState);
}
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers', () => {
const nextReducer = require('../reducers');
store.replaceReducer(nextReducer);
});
}
return store;
}