A callback that receives a builder object to define
case reducers via calls to builder.addCase(actionCreatorOrType, reducer)
.
Alternatively, a mapping from action types to action-type-specific case reducer functions. These reducers should have existing action types used as the keys, and action creators will not be generated.
The initial state that should be used when the reducer is called the first time. This may also be a "lazy initializer" function, which should return an initial state value when called. This will be used whenever the reducer is called with undefined
as its state value, and is primarily useful for cases like reading initial state from localStorage
.
The slice's name. Used to namespace the generated action types.
A mapping from action types to action-type-specific case reducer
functions. For every action type, a matching action creator will be
generated using createAction()
.
Generated using TypeDoc
Options for
createSlice()
.