git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit fb012078e540bbbe5d011e6a55ba2e59a468c3be

hot reload reducers

Michael Williams committed on 12/26/2015, 5:25:00 AM
Parent: 82a40a4cb073f093a6a898da0a5394f59757ed59

Files changed

app/store.jschanged
app/store.jsView
@@ -39,8 +39,15 @@
3939 ...storeEnhancers
4040 )(createStore)
4141
4242 function finalCreateStore(initialState) {
43+
44+ if (module.hot) {
45+ module.hot.accept('app/reducers', () => {
46+ store.replaceReducer(require('app/reducers'))
47+ })
48+ }
49+
4350 return createEnhancedStore(reducer, initialState)
4451 }
4552
4653 module.exports = finalCreateStore

Built with git-ssb-web