mixn
Useful functinos for redux reducers. Allows easy extension of redux reducer functions. Tries each one until the state changes. No dependencies.
Usage
mixn
Mixes reducers in order. The resulting reducer function will try all available reducers until a new state is obtained, thus it is recommended to keep the state object immutable.
const mixn = { } { } { } const reduce = // 110
muxn
Muxes all handler objects and creates a reducer function. A handler object is a
dictionary, which contains action.type
as key and a reducer function(state, action)
* as value. If two handlers each contain a reducer for a specific
action, the last one in order takes precedence.
const muxn = const reduce = // 5
withDefaultState
Wraps a reducer and sets a default state if it is undefined
.
const muxn withDefaultState = const handler = state + actionpayloadconst reduce = // 10
License
Copyright 2017 Jerko Steiner