redux-reducer-generator
v1.0.1
Published
[](https://travis-ci.org/0xc14m1z/redux-reducer-generator) [
const initialState = {
loading: false,
errors: false
}
const SHOW_LOADER = "SHOW_LOADER"
const HIDE_LOADER = "HIDE_LOADER"
const showLoader = (state, action) =>
({ ...state, loading: true })
const hideLoader = (state, action) =>
({ ...state, loading: false })
const map = {
[SHOW_LOADER]: showLoader,
[HIDE_LOADER]: hideLoader
}
const loadingReducer = reducer(initialState, map)
