redux-cac
Helper for create action creators. Action types constants + action creators functions now cames together.
// Actions:const actions = // > actions.increase()// > { type: '@counter/increase', payload: null }// > actions.increaseLater()// > { type: '@counter/increase', payload: null }// > actions.increase(1)// > { type: '@counter/increase', payload: 1 } // Redux storeconst store = // Often it happens in react-redux mapDispatchToPropsconst boundActions = // > boundActions.increase()// > store.getState()// > { count: 1 }
Note! Function
dispatch()
requirethunk
middleware.