Publisher

extension Publisher
  • Map a publisher with Failure type Never to one with Failure type Error

    This can be necessary since in Combine the error types have to match for flatMap. It is tempting to put a where clause on this extension to limit the application of this function to Failure == Never but unfortunately this results in a will never be executed warning in the code below.

    Declaration

    Swift

    public func mapNeverToError() -> AnyPublisher<Output, Error>