DispatchedAction
public struct DispatchedAction<Action>extension DispatchedAction: Decodable where Action: Decodableextension DispatchedAction: Encodable where Action: Encodableextension DispatchedAction: Equatable where Action: Equatableextension DispatchedAction: Hashable where Action: HashableWraps an action and the information about its dispatcher. It can be used when reactive pipelines want to enforce that the result is an action
while keeping track about the source of that action. For example, certain RxSwift, Combine or ReactiveSwift pipeline want to send actions to the
store and because ActionHandler has a function dispatch(_ action: ActionType, from dispatcher: ActionSource), that pipeline should output a
DispatchedAction<Action> to fulfil everything needed by the ActionHandler to feed that action into the store.
- 
                  
                  The action to be handled by the store DeclarationSwift public let action: Action
- 
                  
                  The source of this action DeclarationSwift public let dispatcher: ActionSource
- 
                  
                  Init DispatchedActionby providing the action and the dispatcher explicitly.DeclarationSwift public init(_ action: Action, dispatcher: ActionSource)ParametersactionThe action to be handled by the store dispatcherThe source of this action 
- 
                  
                  Init DispatchedActionby providing the action and the components pointing to the source of this action, such as file, function and line. Those parameters are optional and fallback to Swift precompiled defaults#file,#functionand#line.DeclarationSwift public init(_ action: Action, file: String = #file, function: String = #function, line: UInt = #line, info: String? = nil)ParametersactionThe action to be handled by the store fileFile that dispatched the action, defaults to #filefunctionFunction that dispatched the action, defaults to #functionlineLine that dispatched the action, defaults to #lineinfoOptional extra information about the dispatcher. Useful to aggregate more data about the journey of an action for logging purposes. 
- 
                  
                  Transforms an action while keeping the dispatcher intact DeclarationSwift public func map<NewAction>(_ transform: (Action) -> NewAction) -> DispatchedAction<NewAction>ParameterstransformFunction that will transform an action into another Return Valueanother DispatchedActiongeneric over the new action type. The dispatcher is kept as the original action.
- 
                  
                  Transforms an action while keeping the dispatcher intact DeclarationSwift public func compactMap<NewAction>(_ transform: (Action) -> NewAction?) -> DispatchedAction<NewAction>?ParameterstransformFunction that will transform an action into another, optional Return Valueanother DispatchedActiongeneric over the new action type. The dispatcher is kept as the original action.
 View on GitHub
View on GitHub DispatchedAction Structure Reference
        DispatchedAction Structure Reference