Created
January 1, 2021 22:31
-
-
Save jasdev/0db5153039e2eedb06ed341d07035139 to your computer and use it in GitHub Desktop.
Prefix while inclusive scaffolding.
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 { | |
func prefixInclusive(while predicate: @escaping (Output) -> Bool) -> AnyPublisher<Output, Failure> { | |
flatMap { value in | |
/* … */ | |
} | |
/* … */ | |
.eraseToAnyPublisher() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment