Skip to content

v2.0.1

Compare
Choose a tag to compare
@zalmoxisus zalmoxisus released this 11 Jun 13:46
· 527 commits to master since this release

Added window.devToolsExtension.updateStore(store) method

Use with Redux Saga or store enhancers which change the store object. Specify a new store object to be used by the extension. For example, in case of Redux Saga we can use like this:

const sagaMiddleware = createSagaMiddleware();
const store = createStore(
  reducer,
  compose(
    applyMiddleware(sagaMiddleware),
    window.devToolsExtension && window.devToolsExtension()
  )
);
sagaMiddleware.run(rootSaga);
if (window.devToolsExtension) window.devToolsExtension.updateStore(store);

See the example.

Added serializeState / serializeAction config parameters

Use to customize serialization, for example, to support mori data structures or ES2015 Maps.

  • serializeState(key, value): transformedState (function) - optional serialization function (useful if state is not plain object)
    Example of usage:

      const store = Redux.createStore(reducer, window.devToolsExtension && window.devToolsExtension({
        serializeState: (key, value) => (
          value && mori.isMap(value) ? mori.toJs(value) : value
        )
      }));
  • serializeAction(key, value): transformedAction (function) - optional serialization function (useful if actions are not plain object)