ActionConfiguration
@MainActor
public struct ActionConfiguration<InteractorType, ContentType, Interactor> : ActionConfiguring where InteractorType : InteractorTypeable, ContentType : ContentTypeable, Interactor : AbstractInteractable
An object which configures and builds an Action in an ActionSequence. These configuration objects should be used in conjunction with an ActionSequenceConfiguration object, representing either a single sequence step, or a group of actions defined by an ActionSequenceGroupConfiguration object.
-
Undocumented
Declaration
Swift
public typealias ActionType = Interactor.Request.ActionType -
Declaration
Swift
@MainActor public let interactorType: InteractorType? -
Declaration
Swift
@MainActor public let actionType: ActionType -
Declaration
Swift
@MainActor public let assistant: InteractorAssistantType -
Declaration
Swift
@MainActor public var outputConduit: (any ActionSequenceConduiting<ContentType>)? -
Declaration
Swift
@MainActor public let identifier: (any ActionIdentifying)? -
Declaration
Swift
@MainActor public let shouldEndParentTaskOnFailure: Bool -
Declaration
Swift
@MainActor public let shouldSaveResult: Bool -
An optional object that converts the Interactor’s
Request.ResultDatainto this step’sContentType, needed only when the two types differ. SeeContentTransformablefor more information.Declaration
Swift
@MainActor public let resultTransformer: (any ContentTransformable<Interactor.Request.ResultData, ContentType>)? -
init(interactorType:action: assistant: identifier: shouldEndParentTaskOnFailure: shouldSaveResult: resultTransformer: ) Undocumented
Declaration
Swift
@MainActor public init(interactorType: InteractorType, action: ActionType, assistant: InteractorAssistantType, identifier: (any ActionIdentifying)?, shouldEndParentTaskOnFailure: Bool? = nil, shouldSaveResult: Bool? = nil, resultTransformer: (any ContentTransformable<Interactor.Request.ResultData, ContentType>)? = nil) -
Declaration
Swift
@MainActor public func buildAssistant() throws -> any AsyncInteractorAssisting<InteractorType, ContentType> -
Builds a runnable sequence step from this configuration, constructing the interactor assistant the step will use to make its request. Building the assistant here allows access to the concrete Interactor type, which is erased at the sequence level.
Declaration
Swift
@MainActor public func buildAction(resultHandler: any InteractorResultHandling<InteractorType, ContentType>) throws -> any ActionPerformable<ContentType>Parameters
resultHandlerThe object which should handle the results of the step’s interactor request.
Return Value
A
Resultcontaining the step, or a failure if the configured assistant is incompatible with this configuration’s types.
View on GitHub