Skip to content

Commit

Permalink
Configure Hot Module Replacement for the reducer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 9, 2016
1 parent ab73921 commit 5f8ad09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/store/configureStore.js
Expand Up @@ -19,5 +19,14 @@ export default function configureStore(preloadedState) {
composedEnhancer
);

if(process.env.NODE_ENV !== "production") {
if(module.hot) {
module.hot.accept("../reducers/rootReducer", () =>{
const newRootReducer = require("../reducers/rootReducer").default;
store.replaceReducer(newRootReducer)
});
}
}

return store;
}

0 comments on commit 5f8ad09

Please sign in to comment.