-
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
Observable's next action runs even when not taken #1370
Comments
Possibly related, I've seen similar issues with take and repeat. createObserver(2)
.startWith(1)
.repeat(5)
.take(1)
.subscribe(x => console.log(x));
output:
1
"in subscribe"
"disposed"
"in subscribe"
"disposed"
"in subscribe"
"disposed"
"in subscribe"
"disposed"
"in subscribe"
"disposed" The repeat is re-subscribing even though the take has completed. With the repeat directly after the .create the extra "in subscribe", "disposed" still happen but in a different order. createObserver(2)
.repeat(5)
.startWith(1)
.take(1)
.subscribe(x => console.log(x));
Output:
1
"in subscribe"
"in subscribe"
"in subscribe"
"in subscribe"
"in subscribe"
"disposed"
"disposed"
"disposed"
"disposed"
"disposed" Changing the the repeat count to -1 crashes the program. |
: For this specific issue, please refer #651 (comment). Long story in short, you may need subscribe on non-recursive, different scheduler for infinite (or largely enough) synchronous repeat. |
@pmowrer I just tried snippet with current master, seems it's resolved. (Not sure why it was though). Would you mind to confirm on your end too? |
I can confirm this is fixed on my end. Thanks @kwonoj! |
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. |
The following seems like an injection bug starting in
5.0.0-beta.1
:jsbin: http://jsbin.com/mebonun/6/edit?html,js,console
In RxJS 4.0.6 and in 5.0.0-beta.0, this works like I expect. The created observable is essentially ignored.
but as of 5.0.0-beta.1, the observable's subscribe and dispose functions are invoked:
It'd seem to make sense these don't get invoked, but I'm not certain about the expected behavior honestly.
The text was updated successfully, but these errors were encountered: