Created
April 14, 2020 19:19
-
-
Save mbrandonw/f95adea285e8769efb6e24381f47969c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension Publisher where Failure == Never { | |
| func promoteError<E>(_ errorType: E.Type = E.self) -> AnyPublisher<Output, E> { | |
| func never<A>(_ never: Never) -> A {} | |
| return self | |
| .mapError(never) | |
| .eraseToAnyPublisher() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment