Skip to content

Instantly share code, notes, and snippets.

@stleamist
Created June 15, 2020 13:05
Show Gist options
  • Save stleamist/e3530f7088d12af266a0bcbd3c04be98 to your computer and use it in GitHub Desktop.
Save stleamist/e3530f7088d12af266a0bcbd3c04be98 to your computer and use it in GitHub Desktop.
import Combine
extension Publisher {
func printError() -> Publishers.HandleEvents<Self> {
return self.handleEvents(receiveCompletion: { completion in
if case .failure(let error) = completion {
Swift.print("receive error: \(error)")
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment