Skip to main content

Create Reducer


Parameters#

NameRequiredTypeDescription
actionstrue-Actions object
defaultStatetrueObjectDefault state value
const defaultState = {}
const actions = {  action1: yourAction}
createReducer(actions, defaultStatus) 

Note After creating the reducer, the actions are registered and after that they will be available in useActions hook

const { action1 } = useActions()