Method CreateReducer
CreateReducer<TState>(TState, Action<ReducerSwitchBuilder<TState>>)
Create reducers for a state slice. See SliceReducerSwitchBuilder<TState> for more information.
Declaration
public static Reducer CreateReducer<TState>(TState initialState, Action<ReducerSwitchBuilder<TState>> builderCallback)
Parameters
Type | Name | Description |
---|---|---|
TState | initialState | The initial state of the state slice. |
Action<ReducerSwitchBuilder<TState>> | builderCallback | The builder that will be used to create the reducers. |
Returns
Type | Description |
---|---|
Reducer | A reducer record that can be used to create a state slice. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state. |