createActionreturns a sub-reducer that checks each incoming action's type against the one specified and, on a match, delegates to the passed reducer-like
getNextStatefunction. For non-matching actions, the sub-reducer simply returns the unchanged input state.
createAction; in this case, the action creator's
typeproperty is used to determine the action type.
subReducerparameter, or by combining
createActionaction creator, the type of the
actionparameter will be automatically inferred from the type of the action creator.