1.1.1 • Published 8 years ago
@f/reduce-replace v1.1.1
reduce-replace
A reducer that replaces the accumulator with the next value
Installation
$ npm install @f/reduce-replace
Usage
var reduceReplace = require('@f/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