Skip to content

Instantly share code, notes, and snippets.

@pfulop
Created August 24, 2016 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfulop/30796d0984a637ef3025a4c150e49bc0 to your computer and use it in GitHub Desktop.
Save pfulop/30796d0984a637ef3025a4c150e49bc0 to your computer and use it in GitHub Desktop.
import { createStore } from 'redux';
import rootReducer from '../reducers';
export default function configureStore () {
const store = createStore(rootReducer);
if (module.hot) {
module.hot.accept(() => {
const nextRootReducer = require('../reducers/index').default;
store.replaceReducer(nextRootReducer);
});
}
return store;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment