.setFailureType(to: Error.self)

Updated
Sep 19, 2019 2:01 PM
Created
Sep 19, 2019 2:00 PM
Tags
SwiftCombine
Keywords
Date

How can I convert a Just<T> to an AnyPublisher<T, Error>?

Just(x)
    .setFailureType(Error.self)
    .eraseToAnyPublisher()