-
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.interval in inactive tab work different than plain js setInterval() #3042
Comments
you can't expect interval observable works identical to setInterval as interval observable have scheduling to create inverval values.
|
@kwonoj Rly? So if Observable.interval will be called after 1500 ms instead of expected 1000 ms this is fine? |
If you check it in jsbin with RxJs 5.0.3 it works as expected, in 5.5.2 it doesn't! |
hmm, yeah that sounds odd. I thought it's happening all time. |
Reopened. |
In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes ReactiveX#3042
In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes ReactiveX#3042
You need to be careful relying on setInterval, setTimeout, etc in JSBin, I've seen some odd behavior there, and I think it's being patched or hooked in some way by JSBin. |
Thanks for the hint! I will pay attention to it. |
In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes ReactiveX#3042
In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes ReactiveX#3042
In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes ReactiveX#3042
* test(scheduler): add interval recycling tests * fix(scheduler): prevent unwanted clearInterval In AsyncAction, this.pending was assigned before the call to recycleAsyncId. That prevented the interval from being re-used resulting in the interval being cleared and re-created for each notification. Closes #3042
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. |
Observable.interval in inactive tab work different than plain js setInterval()
Open http://jsbin.com/muvaqipaqa/1/edit?html,js,console,output
See 'i:0', 'j:0', ... in console. Switch to another browser tab for 30 seconds or so. Switch back to jsbin tab. See that i have much more different value than j
RxJS version:
5.5.2
Code to reproduce:
http://jsbin.com/muvaqipaqa/1/edit?html,js,console,output
Expected behavior:
i and j have same values
Actual behavior:
i and j have different values
The text was updated successfully, but these errors were encountered: