reapp-reducer
v1.0.1
Published
reduces objects or arrays into an array of objects with { id, status, data }
Downloads
8
Readme
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' }]