lenrix icon indicating copy to clipboard operation
lenrix copied to clipboard

webpack hot module reload support

Open c-jacquin opened this issue 6 years ago • 1 comments

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

c-jacquin avatar Jun 24 '18 12:06 c-jacquin

It seems like it can be done. I have to find a couple hours to write the code. Is it urgent ?

couzic avatar Jun 25 '18 08:06 couzic