-
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
fix(repeat): Ensure teardown happens between repeated synchronous obs… #5620
fix(repeat): Ensure teardown happens between repeated synchronous obs… #5620
Conversation
…ervables - Simplifies repeat code - Removes reliance on unsubscribeAndRecycle - Gets rid of strange, undocumented behavior where numbers less than zero were treated like positive infinity - Fixes an issue where `finalize` would be called N times after the completion of the resulting observable if the source was synchronous. - Fixes an issue where N unsubscriptions would always occur after the total completion. BREAKING CHANGE: An undocumented behavior where passing a negative count argument to `repeat` would result in an observable that repeats forever.
I seriously considered removing I suspect that |
…onous observables Related: ReactiveX#5620 - Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
if (++soFar < count) { | ||
if (innerSub) { | ||
subscription.remove(innerSub); | ||
innerSub.unsubscribe(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason innerSub
is not nulled here?
I think that if it isn't, there will be a problem if the source is async on the first subscription and sync on a subsequent subscription - as innerSub
won't be null
for the subsequent completion, despite that completion being synchronous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope... just didn't think of it. Also, that remove
is superfluous, teh unsubscribe
will do that...
…onous observables Related: ReactiveX#5620 - Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
…onous observables Related: #5620 - Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
…ervables
finalize
would be called N times after the completion of the resulting observable if the source was synchronous.BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to
repeat
would result in an observable that repeats forever.