reapp-reducer

1.0.1 • Public • Published

reapp-reducer

Simple reducer for use with flux. Reduces an array or map into an array of objects with: { id, data, status }

Status is given first so we can allow currying, ex:

var loadedReducer = reducer.bind(null, 'LOADED');
 
fetch(url).then(loadedReducer).then(store);

status is optional, default value is 'OK'

assert(reducer([1]) === [{ id: 0, data: 1, status: 'OK' }]

Readme

Keywords

none

Package Sidebar

Install

npm i reapp-reducer

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • jhopper28
  • nwienert