reduce-replace
A reducer that replaces the accumulator with the next value
Installation
$ npm install @micro-js/reduce-replace
Usage
var reduceReplace = require('@micro-js/reduce-replace')
const todoReducer = combineReducers({
text: handleActions({
[TODO_SET_TEXT]: reduceReplace({text} => text),
})
})
API
reduceReplace(fn)
-
fn
- Transforms the 2nd parameter to reduce. Defaults to https://github.com/micro-js/identity.
Returns: A reducer that replaces the accumulator with the value returned by fn(value)
.
License
MIT