Created
November 24, 2020 05:30
-
-
Save stleamist/957630fcaab7120e7665aa6616f3f9d8 to your computer and use it in GitHub Desktop.
This file contains 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
import Combine | |
public extension Publisher { | |
func flatMap<P: Publisher>( | |
_ transformPublisher: @escaping (Self.Output) -> P, | |
mapError transformError: @escaping (Self.Failure) -> P.Failure | |
) -> Publishers.FlatMap<P, Publishers.MapError<Self, P.Failure>> { | |
return self.mapError(transformError).flatMap(transformPublisher) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment