Created
April 2, 2020 14:56
-
-
Save jasdev/8cbb99bb5fca5b12dfae49ce3df44a32 to your computer and use it in GitHub Desktop.
Implemented `Publisher.values` and `.errors`.
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 where Output: EventConvertible { | |
func values() -> Publishers.CompactMap<Self, Output.Output> { | |
compactMap(\.event.value) | |
} | |
func errors() -> Publishers.CompactMap<Self, Output.Failure> { | |
compactMap(\.event.error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment