Skip to content

derived addAsyncReducer method

Compare
Choose a tag to compare
@anru anru released this 27 Dec 12:23
· 40 commits to master since this release

Now makeLocalStore doesn't apply asyncReducer by default. In order to do same behaviour you should call new exported method addAsyncReducer to your reducer. Like this:

export _.flowRight(
  makeLocalStore(addAsyncReducer(reducer)), // async state will be available in `asyncActions` namespace
  connect(...)
)(SuperAwesomeComponent);

Or, in order to have async state directly in root state object:

export _.flowRight(
  makeLocalStore(addAsyncReducer(reducer, null)), // async state will be available as is, without any namespace
  connect(...)
)(SuperAwesomeComponent);