Read the introduction here: Functions as Redux actions
Demo App: https://dtinth.github.io/redux-send/
A Redux middleware that wraps message functions that are dispatched to the store in { type: 'SEND_MESSAGE', message: message }
.
Creates a Redux reducer which forwards the message to the model.
A Model is an Object with these keys:
getInitialState
:: () → ModelState- All other keys are methods that take any arbitrary argument returns a ModelUpdater<ModelState>
A ModelState is any JavaScript object that holds the state of your application.
A ModelUpdater is a function that takes a model state and returns the next state.
You can dispatch a function of type (Model → ModelUpdater), then redux-send
will update the state according to the returned updater.