Skip to content

TehShrike/create-redux-reducer-from-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My own personal preference for building reducers for Redux.

var makeReducer = require('create-redux-reducer-from-map')

const arithmeticReducer = makeReducer({
	ADD: (state, action) => state + action.payload,
	SUBTRACT: (state, action) => state - action.payload
}, 0)

makeReducer(mapOfFunctions[, initialState])

Returns a reducer appropriate for Redux. Takes a map of action types to functions taking (state, action).

License

WTFPL

About

My personal preference for building reducer functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published