ActionHandler
public protocol ActionHandler
                ActionHandler defines a protocol for entities able to handle actions - defined by the associated type ActionType.
The only protocol requirement is a function that allows other entities to dispatch actions, so Views (or Presenters, ViewModels) in your UI layer, or even Middlewares can create actions of a certain type and send to your store, that is generalized by this protocol.
- 
                  
                  
Undocumented
Declaration
Swift
associatedtype ActionType - 
                  
                  
The function that allows Views, ViewControllers, Presenters to dispatch actions to the store. Also way for a
Middlewareto trigger their own actions, usually in response to events or async operations.Declaration
Swift
func dispatch(_ dispatchedAction: DispatchedAction<ActionType>)Parameters
dispatchedActioncontainer for action (the action to be dispatched) + dispatcher (information about the action source, containing file/line, function and additional information for debugging and logging purposes)/
 - 
                  
eraseToAnyActionHandler()Extension methodErases the provided
ActionHandlerby using its inner methods from a newly created wrapper of typeAnyActionHandlerDeclaration
Swift
public func eraseToAnyActionHandler() -> AnyActionHandler<ActionType> - 
                  
dispatch(_:Extension methodfile: function: line: info: ) The function that allows Views, ViewControllers, Presenters to dispatch actions to the store. Also way for a
Middlewareto trigger their own actions, usually in response to events or async operations.Declaration
Swift
public func dispatch(_ action: ActionType, file: String = #file, function: String = #function, line: UInt = #line, info: String? = nil)Parameters
actionthe action to be dispatched
fileFile that created and dispatched the action, by default this is the file calling the
dispatchfunctionfunctionFunction that created and dispatched the action, by default this is the function calling the
dispatchfunctionlineLine in the file where the action was created and dispatched, by default this is the line from where the
dispatchfunction was calledinfoAdditional information about the moment where the action was dispatched. This is an optional String that can hold information useful for debugging, logging, monitoring or analytics. By default this is nil but you can add any information useful to trace the journey of this action.
 - 
                  
dispatch(_:Extension methodfrom: ) The function that allows Views, ViewControllers, Presenters to dispatch actions to the store. Also way for a
Middlewareto trigger their own actions, usually in response to events or async operations.Declaration
Swift
public func dispatch(_ action: ActionType, from dispatcher: ActionSource)Parameters
actionthe action to be dispatched
dispatcherinformation about the action source, containing file/line, function and additional information for debugging and logging purposes
 - 
                  
contramap(_:Extension method) Pullback an
ActionHandlerworking in a local action context, into a newActionHandlerworking in a more global action context.Declaration
Swift
public func contramap<NewActionType>(_ transform: @escaping (NewActionType) -> ActionType) -> AnyActionHandler<NewActionType>Parameters
transforma function that allows to go from a global action to a local action
Return Value
a new
ActionHandlerthat knows how to handle the new action type 
View on GitHub
        ActionHandler Protocol Reference