Structure
HandleEvents
public struct HandleEvents<Parent: Endpoint>
A struct
defining a custom endpoint
implementation handling success and failures
of an existing one, without modifying them.
Relationships
Conforms To
Endpoint
LoopEndpoint
Initializers
init(_:with:)
public init(
@EndpointBuilder _ parent: () -> Parent,
with handler: @escaping (Result<Parent.Output, any Error>) -> Void
)
Init.
Parameters
Name | Type | Description |
---|---|---|
parent | () -> Parent |
A valid |
handler | @escaping (Result<Parent.Output, any Error>) -> Void |
The event handler. |
Methods
_resolve(with:)
@_spi(Private)
public func _resolve<R: EndpointResolver>(with session: R) -> AsyncThrowingStream<Parent.Output, any Error>
Fetch responses, from a given
Input
and URLSession
.
Parameters
Name | Type | Description |
---|---|---|
session | R |
The |
Returns
Some AsyncStream
.
_resolve(with:)
@_spi(Private)
public func _resolve<R: EndpointResolver>(with session: R) -> AnyPublisher<Parent.Output, any Error>
Fetch responses, from a given
Input
and URLSession
.
Parameters
Name | Type | Description |
---|---|---|
session | R |
The |
Returns
Some AsyncStream
.