@bruitt/reducer

``` import createReducer from '@bruitt/reducer'

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
30Jan 22, 2017Oct 21, 2016Minified + gzip package size for @bruitt/reducer in KB

Readme

@bruitt/reducer

import createReducer from '@bruitt/reducer'

let initialState = {
  data: null,
  loading: false,
  error: {
    code: 0,
    message: '',
    value: false
  }
}

let putData = R.assoc('data')
let putLoading = R.assoc('loading')
let putError = R.assoc('error')

export default createReducer({
  takeData: null,
  takeEffect: {
    nil: doStuff,
    start: ...,
    success: ...,
    failure: ...,
    finish: ...
  },
  putData,
  putLoading,
  putError
}, 'ns/domain', initialState)

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.