@f/reduce-replace

A reducer that replaces the accumulator with the next value

Usage no npm install needed!

<script type="module">
  import fReduceReplace from 'https://cdn.skypack.dev/@f/reduce-replace';
</script>

README

reduce-replace

Build status Git tag NPM version Code style

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)

Returns: A reducer that replaces the accumulator with the value returned by fn(value).

License

MIT