-
Notifications
You must be signed in to change notification settings - Fork 3k
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
split the method “subscribe” into two steps to get the subscription instance in handle function #3206
Conversation
Generated by 🚫 dangerJS |
Fuck, too complicated to commit! |
may I ask what's the intent of |
Hi @Brooooooklyn @example unsubscribe in the handle function const subscription = Rx.Observable.of(1, 2, 3).subscribe( |
@Brooooooklyn because the subscribe function do not return the subscription immediately, sometimes we need to get the subscription instance before the action start. |
@Brooooooklyn do you agree with me?and you know how to submit it correctly? |
@ArthasModern Thanks for the PR! However, IMO I don't think this is a good way to approach this problem. Explicit unsubscribe, especially in the I'll wait for some of the core contributors to chime in, since I am pretty far removed from what does or doesn't go into this library, but that is my two cents. |
I agree with @paulpdaniels , you should never |
@paulpdaniels Thank you very much for your answer! |
OK, it's just my personal opinion. Thank you very much for your advice! |
As suffeciently described above there are discussions of controlling interfaces for observables and I don't think we'll pursue this proposed interfaces. |
I don't think we can accept this PR. There are other designs around how to handle this. One is the start event, added to the TC39 Proposal, and it gives you the Subscription just before the Observable body is executed. The other is to hand the Subscription to the next callback as a second argument, and that's being looked at in the WHATWG proposal. Both proposals are cooperating and will align at some point, but it's not a big issue. So until the proposals settle, we're going to hold off on adding anything. (I had added the start handler briefly in the past). Thank you so much for your thought and effort, @ArthasModern! I know it's hard to have a PR closed. Hopefully you continue to contribute! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
Related issue (if exists):