Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created January 1, 2021 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdev/0db5153039e2eedb06ed341d07035139 to your computer and use it in GitHub Desktop.
Save jasdev/0db5153039e2eedb06ed341d07035139 to your computer and use it in GitHub Desktop.
Prefix while inclusive scaffolding.
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