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' }]
Dependencies (0)
Dev Dependencies (0)
Package Sidebar
Install
Weekly Downloads