redux-functor
v1.0.0
Published
Functor middleware for redux
Downloads
431
Readme
redux-functor
Functor middleware for redux.
Usage
functor : Store -> Function -> Action -> a
Redux middleware to dispatch actions that are functors. This includes the built-in javascript Array
type, along with many other ADT's.
If any action has a property called map
that is a function, the action is assumed to be a functor.
const { applyMiddleware, combineReducers, createStore } = require('redux')
const functor = require('redux-functor')
const reducers = require('../ducks')
const store = createStore(combineReducers(reducers), applyMiddleware(functor))