AsyncActionReducerType
public protocol AsyncActionReducerType
An ActionReducer, takes a given action and a given state and returns a new state
-
Undocumented
Declaration
Swift
associatedtype ReducerStateType
-
Undocumented
Declaration
Swift
associatedtype ReducerActionType : Action
-
isResponsible(action:state:)
Default implementationCheck if this reducer is responsible for a given action and state
Default Implementation
Check if this reducer is responsible for a given action and state
Note
The default implementation simply checks if the given action and state conform to the reducers action and state typesDeclaration
Swift
func isResponsible(action: Action, state: Any) -> Bool
Parameters
action
a given action
state
a given state
Return Value
returns if the reducer is responsible for this action/state pair
-
Take a given action, modify a given state and return a new state
Declaration
Swift
func reduce(provider: ReducerProvider, action: ReducerActionType, completion: @escaping (_ newState: ReducerStateType) -> Void)
Parameters
provider
the reducer container of your application
action
a given action
state
a given state
Return Value
the new state