ReducerProvider
public protocol ReducerProvider
An object which gives you all responsible reducers for a given action and state
-
Returns all responsible synchron reducers for a given action, state pair
Declaration
Swift
func reducers<StateType>(action: Action, state: StateType) -> [AnyActionReducer]
Parameters
action
an action
state
the current state
Return Value
all responsible reducers for this action state pair
-
Returns all responsible async reducers for a given action, state pair
Declaration
Swift
func reducers<StateType>(action: Action, state: StateType) -> [AnyAsyncActionReducer]
Parameters
action
an action
state
the current state
Return Value
all responsible reducers for this action state pair
-
reduce your state for an action, for all responsible reducers
Declaration
Swift
func reduce<StateType>(action: Action, state: StateType) -> StateType
Parameters
action
an action
state
your current state
Return Value
your new state
-
reduce your state for an action, for all responsible reducers
Declaration
Swift
func reduce<StateType>(action: Action,state: StateType, completion: @escaping () -> Void) -> StateType
Parameters
action
an action
state
your current state
completion
copletion called when the action was reduced
Return Value
your new state