Type of initial state
Creates a new instance of the class using the given value as default initial state for the resulting reducer.
Default initial state for the reducer
Add a new action handler function for the given action name. The function passed in receives the current state and action with potential payload as parameters.
The name of the action corresponding to the reducer function
The function to be invoked in response to the given action.
Returns a single reducer function, which is a combination of all handlers
added through addHandler()
. This resulting function can then be passed
to combineReducers()
.
A single reducer function which combines all action handlers into one
Generated using TypeDoc
This class represents an alternative to creating reducer functions with big and unwieldy switch statements. A new instance of this class is initialised with the initial state for the reducer. Following that, new action handler functions can be added via the
addHandler()
method, supplying action names a strings. Finally, a complete reducer function, which can be passed tocombineReducers()
, can be obtained by callinggetReducer()
.