APIClientPublisher

public struct APIClientPublisher<Response> : Publisher

Undocumented

  • Declaration

    Swift

    public typealias Output = Response
  • Declaration

    Swift

    public typealias Failure = Error
  • Start a http request sequence from a recycled APIClient and initial endpoint
    

    Declaration

    Swift

    public init(client: APIClient, endpoint: Endpoint<Response>)

    Parameters

    client

    The APIClient instance to be used for the sequence of requests

    endpoint

    The Endpoint for the first request

  • Declaration

    Swift

    public func receive<S>(subscriber: S) where Response == S.Input, S : Subscriber, S.Failure == APIClientPublisher<Response>.Failure
  • Make a next request depending on the output of the previous

    Declaration

    Swift

    public func chain<T>(_ pipe: @escaping (Response) -> Endpoint<T>) -> APIClientPublisher<T>

    Parameters

    pipe

    A closure receiving Endpoint.Result of the current endpoint and returning a new endpoint from that