Create Reducer
#
ParametersName | Required | Type | Description |
---|---|---|---|
actions | true | - | Actions object |
defaultState | true | Object | Default 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()