createAction
returns a sub-reducer that checks each incoming action's type against the one specified and, on a match, delegates to the passed reducer-like getNextState
function. For non-matching actions, the sub-reducer simply returns the unchanged input state.createAction
; in this case, the action creator's type
property is used to determine the action type.withInitialState
and its subReducer
parameter, or by combining withInitialState
and chainReducers
.createAction
action creator, the type of the getNextState
function's action
parameter will be automatically inferred from the type of the action creator.createAction
action creator: