1.0.0 • Published 6 years ago

redux-functor v1.0.0

Weekly downloads
536
License
MIT
Repository
github
Last release
6 years ago

redux-functor

redux-functor Build Status Coverage Status NSP Status

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))