-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup: consider splitting "complete" vs "error" #78
Comments
@bakkot this is more akin to |
This doesn't sound correct, right? The original concern sounds producer-focused, to provide a way to detect error() vs complete() from the producer. Not about separating out whether the consumer did anything. In general though, I do agree with the Promise |
It's less that I was unsure about the utility and more that I wanted to raise the possibility of aligning with the precedent in web streams, which are similar in some ways. If that alignment isn't worth it, that's fine. |
I see. It's tricky because it seems like there's precedent set by both streams (splitting the hooks, as you mentioned), and also Promises (with |
Right now there is a proposed
finally
which is called regardless of how the observable is closed.Web streams split this into two hooks: one called on normal exit, one called on error. (There is an old issue suggesting a
finally
, but there's no movement on it.)It may be desirable to match web streams. Or it may not. I moderately prefer a single hook personally, although in some scenarios it's nice to know which kind of exit this was.
The text was updated successfully, but these errors were encountered: