Commit fb012078e540bbbe5d011e6a55ba2e59a468c3be
hot reload reducers
Michael Williams committed on 12/26/2015, 5:25:00 AMParent: 82a40a4cb073f093a6a898da0a5394f59757ed59
Files changed
app/store.js | changed |
app/store.js | ||
---|---|---|
@@ -39,8 +39,15 @@ | ||
39 | 39 | ...storeEnhancers |
40 | 40 | )(createStore) |
41 | 41 | |
42 | 42 | function finalCreateStore(initialState) { |
43 | + | |
44 | + if (module.hot) { | |
45 | + module.hot.accept('app/reducers', () => { | |
46 | + store.replaceReducer(require('app/reducers')) | |
47 | + }) | |
48 | + } | |
49 | + | |
43 | 50 | return createEnhancedStore(reducer, initialState) |
44 | 51 | } |
45 | 52 | |
46 | 53 | module.exports = finalCreateStore |
Built with git-ssb-web