Redux Reactor
NOTE: This is still work in progress..
Side-effect middleware for Redux.
npm install --save redux-reactor
ES modules:
CommonJS:
const reactor = default;
As you can see, if you use CommonJS require
it also requires .default
at the end.
Why Do I Need This?
If you’re not sure whether you need it, you probably don’t.
Reactors can be used to orchestrate asynchronous flows in your redux application. See examples for use cases.
Motivation
Redux Reactor allows you wait for actions to be dispatched and react to them (in whatever way you like) and if applicable, dispatch new actions. The tools you are given are takeDispatchOf
and takeEveryDispatchOf
that you are expected to use together with async / await
from ESNext.
Examples
Examples 1:
// ... Examples coming
Installation
npm install --save redux-reactor
Then, to enable Redux Reactor, use applyMiddleware()
:
;;; // Import your reactors; // Note: this API requires redux@>=3.1.0const store = ;
License
MIT