Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix(timer): fix #314, setTimeout/interval should return original timerId #894

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

JiaLiPassion
Copy link
Collaborator

fix #314

in browser and nodejs, setTimeout, setInterval should return original timerId (number or Timer object) instead of ZoneTask, because it will break some logic if other libraries expect the standard data types.

@JiaLiPassion
Copy link
Collaborator Author

JiaLiPassion commented Sep 10, 2017

don't know why saucelabs can't launch safari 10 on macOS 10.12, I will ask for solution in saucelabs site.

I am still asking in saucelabs forum, and I just modified the settings in another PR, #896

And saucelabs just reply current safari 10 on macOS 10.12 only support selenium 2.48.

@mhevery mhevery merged commit aec4bd4 into angular:master Sep 13, 2017
@tkohr
Copy link

tkohr commented Oct 2, 2017

We call setInterval() in our angular 4 application. Until zone.js 0.8.17 this returned us a ZoneTask with a runCount attribute, which we used in further code. Do I understand it right that this is not possible anymore following this change (as the timerId is now returned from 0.8.18)?

@JiaLiPassion
Copy link
Collaborator Author

@tkohr , yes, from 0.8.18, setTimeout will return original timerId instead of ZoneTask. Because we think we should not break the standard APIs, could you describe your use case why you need the zoneTask.runCount?

@tkohr
Copy link

tkohr commented Oct 3, 2017

@JiaLiPassion , our use case is the following: We call REST API A every 20 seconds with setInterval and API B on every 20th call of A using zoneTask.runCount. This counter was convient to us but can be replaced by a counter we generate, of course. If setInterval will continue to return the id in future versions of zone.js we will adapt our code accordingly. Will this be the case?

@JiaLiPassion
Copy link
Collaborator Author

@tkohr , yeah, I see, I believe the setInterval will return id just like the standard API does, so please change your application code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zone.js breaks GWT code
4 participants