DefaultAsyncInteractorAssistant
@MainActor
public struct DefaultAsyncInteractorAssistant<InteractorType, Request, ContentType> : AsyncInteractorAssisting where InteractorType : InteractorTypeable, Request : InteractorRequestConfiguring, ContentType : ContentTypeable
A default assistant to be used to configure async interactor actions. This assistant passes along the given action type and optional content along with the request to the Interactor. If the incoming content is the same type as the Request’s RequestContentType, it is also passed to the request’s init(action:content:) initializer, otherwise no content is passed in.
If the Interactor’s Request.RequestContentType/Request.ResultData differ from ContentType, supply inputTransformer/outputTransformer to bridge them instead of relying on the direct cast — this is what backs transformer(request:result:).
-
Declaration
Swift
@MainActor public let interactorType: InteractorType -
Declaration
Swift
@MainActor public var requestMethod: InteractorRequestMethod -
Undocumented
Declaration
Swift
@MainActor public init(interactorType: InteractorType, inputTransformer: (any ContentTransformable<ContentType, Request.RequestContentType>)? = nil, outputTransformer: (any ContentTransformable<Request.ResultData, ContentType>)? = nil) -
handleAsyncRequest(destination:AsynchronousactionType: content: ) Declaration
Swift
@MainActor public func handleAsyncRequest<Destination>(destination: Destination, actionType: Request.ActionType, content: ContentType?) async where InteractorType == Destination.InteractorType, Destination : Destinationable -
asyncRequest(destination:AsynchronousactionType: content: ) Declaration
Swift
@MainActor public func asyncRequest<Destination>(destination: Destination, actionType: Request.ActionType, content: ContentType?) async -> Result<Request.ResultData, any Error> where InteractorType == Destination.InteractorType, Destination : InteractorResultHandling -
Overrides the default erasure-bridging behavior to apply
outputTransformer(when present) to the Interactor’s raw result. AresultTransformersupplied by the caller (e.g. anAction/sequence step’sActionConfiguration) takes precedence over this assistant’s ownoutputTransformer.Declaration
Swift
@MainActor public func resolveAsyncRequest<Destination>(destination: Destination, actionType: any InteractorRequestActionTypeable, content: ContentType?, resultTransformer: ContentTransformerWrapper<ContentType>?) async -> Result<ContentType, any Error> where InteractorType == Destination.InteractorType, Destination : InteractorResultHandling -
asyncRequest(interactor:AsynchronousactionType: content: ) Undocumented
Declaration
Swift
@MainActor public func asyncRequest<Interactor>(interactor: Interactor, actionType: Request.ActionType, content: ContentType?) async -> Result<Request.ResultData, Error> where Request == Interactor.Request, Interactor : AsyncInteractable -
View on GitHub