Skip to content
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

using Timer._called #1539

Closed
ORESoftware opened this issue Oct 9, 2018 · 5 comments
Closed

using Timer._called #1539

ORESoftware opened this issue Oct 9, 2018 · 5 comments

Comments

@ORESoftware
Copy link

How stable/safe is it to reference _called on a timer for library code?

const to = setTimeout(() => {
  console.log(to._called);
}, 10);

console.log(to._called);

before it times out, it is false, after it times out, it is true.
Is this a stable API, can we use it?

@ORESoftware
Copy link
Author

bamp

@addaleax
Copy link
Member

I guess this wouldn’t be removed without a semver-major change, but you can’t be sure of that. It’s not stable API, and it’s not even public API – if you need something like this, you could propose something like timer.called as a public API that forwards this.

@ORESoftware
Copy link
Author

ORESoftware commented Oct 18, 2018

@addaleax yes that makes sense, since you have Le Clout do you want to propose on the Node Github issues? O/w I can do it

@gireeshpunathil
Copy link
Member

@ORESoftware - looking at the code, nodejs/node#20555 seems to have removed this field. And given the main intent of that PR is to improve timer performance, I guess an RFE for the above API may require a justification in terms of use case, inability to meet some programming scenarios etc.

@gireeshpunathil
Copy link
Member

no action identified, closing

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

No branches or pull requests

3 participants