Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created April 4, 2020 23:29
Show Gist options
  • Save jasdev/85b093150c8e9399da7edc5fe62b2d00 to your computer and use it in GitHub Desktop.
Save jasdev/85b093150c8e9399da7edc5fe62b2d00 to your computer and use it in GitHub Desktop.
A `setFailureType` implementation.
extension Publisher where Failure == Never {
func ourSetFailureType<NewFailure>(to failureType: NewFailure.Type)
-> Publishers.MapError<Self, NewFailure> {
mapError { _ -> NewFailure in }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment