ReducerContainerImpl
open class ReducerContainerImpl : StateChangingReducerContainer
Undocumented
-
Undocumented
Declaration
Swift
open var dispatchStateChangeActionCallback: ((Action) -> Void)?
-
Undocumented
Declaration
Swift
public init()
-
Add a sychron reducer to the container
Declaration
Swift
open func addReducer<R>(reducer: R) where R : ActionReducerType
Parameters
reducer
a reducer
-
Add a asynchron reducer to the container
Declaration
Swift
open func addReducer<R>(reducer: R) where R : AsyncActionReducerType
Parameters
reducer
a reducer
-
Add a reduce function to the container
Declaration
Swift
open func addReduceFunction<StateType, ActionType: Action>(reduceFunction: @escaping (_ provider: ReducerProvider,_ action: ActionType, _ state: StateType) -> StateType)
Parameters
reduceFunction
a reduce function
-
Returns all responsible synchron reducers for a given action, state pair
Declaration
Swift
open 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
open 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
open 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
open 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