lenrix
lenrix copied to clipboard
webpack hot module reload support
In order to make webpack hot module reload work properly we need to have something like this to update the store when an update, a computed value or an epic is modified.
redux and redux-observable already implement this feature.
Do you think it is possible ? easy ?
if (module.hot) {
module.hot.accept('../reducers', () =>
store.replaceReducer(require('../reducers')) // eslint-disable-line global-require
);
const epic$ = new BehaviorSubject(rootEpic);
module.hot.accept('./where-ever-they-are', () => {
const nextRootEpic = require('./where-ever-they-are').rootEpic;
epic$.next(nextRootEpic);
});
}
https://redux-observable.js.org/docs/recipes/HotModuleReplacement.html
It seems like it can be done. I have to find a couple hours to write the code. Is it urgent ?