Structure
FlatMap
public struct FlatMap<Parent: SingleEndpoint, Child: Endpoint>
A struct
defining a custom endpoint
implementation handling a request generated
by the response of a previous one.
This is only available for SingleEndpoint
Parent
s cause we want to be sure to
guarantee a deterministic ordering for outputs
which is choerent with user expectations (i.e.
work like Combine), and it wouldn't
otherwise be possible by extending it to
LoopEndpoint
s.
Relationships
Conforms To
Endpoint
LoopEndpoint
Nested Type Aliases
Initializers
init(_:to:)
public init(
@EndpointBuilder _ parent: () -> Parent,
@EndpointBuilder to child: @escaping (Parent.Output) -> Child
)
Init.
Parameters
Name | Type | Description |
---|---|---|
parent | () -> Parent |
A valid |
child | @escaping (Parent.Output) -> Child |
A valid |
Methods
_resolve(with:)
@_spi(Private)
public func _resolve<R: EndpointResolver>(with session: R) -> AsyncThrowingStream<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<Output, any Error>
Fetch responses, from a given
Input
and URLSession
.
Parameters
Name | Type | Description |
---|---|---|
session | R |
The |
Returns
Some AsyncStream
.