InteractorAssisting
@MainActor
public protocol InteractorAssisting<Destination>
This protocol represents an assistant which helps a Destination make requests of an interactor. Concrete assistants conforming to this protocol should handle requests for a specific interactor type.
-
An enum which defines types of Interactors. Each Destination may have its own Interactor types.
Declaration
Swift
associatedtype InteractorType : InteractorTypeable
-
A configuration model which defines an interactor request.
Declaration
Swift
associatedtype Request : InteractorRequestConfiguring
-
A Destination type.
Declaration
Swift
associatedtype Destination : Destinationable
-
The type of interactor.
Declaration
Swift
@MainActor var interactorType: InteractorType { get }
-
The type of action requested of the interactor.
Declaration
Swift
@MainActor var actionType: Request.ActionType { get set }
-
A type that represents whether the interactor request should be made using concurrency or not.
Declaration
Swift
@MainActor var requestMethod: InteractorRequestMethod { get set }
-
A completion closure used to handle an interactor response in a non-async request.
Declaration
Swift
@MainActor var completionClosure: DatasourceResponseClosure<[Request.ResultData]>? { get set }
-
handleAsyncRequest(destination:
Default implementation, asynchronous) Handles an async request to an interactor.
Default Implementation
Declaration
Swift
@MainActor func handleAsyncRequest(destination: Destination) async
Parameters
destination
The Destination which the interactor is associated with. This reference is used to make requests to the interactor.
-
handleRequest(destination:
Default implementation) Handles a non-async request to an interactor. Responses to the interactor should be handled using the
completionClosure
closure.Default Implementation
Declaration
Swift
@MainActor func handleRequest(destination: Destination)
Parameters
destination
The Destination which the interactor is associated with. This reference is used to make requests to the interactor.