Created
March 3, 2020 16:12
-
-
Save juliancadi/278bf814f1756bb4f42d48355f7e8a9f to your computer and use it in GitHub Desktop.
Combine side effect
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
extension Publisher { | |
public func on(_ f: @escaping (Self.Output) -> Void) -> AnyPublisher<Self.Output, Self.Failure> { | |
self.map { | |
f($0) | |
return $0 | |
}.eraseToAnyPublisher() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment