Skip to content

webpack hot module reload support #48

@c-jacquin

Description

@c-jacquin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions