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

Suggestion: describe setTimeout limitations? #29522

Closed
DanKaplanSES opened this issue Oct 6, 2023 · 2 comments
Closed

Suggestion: describe setTimeout limitations? #29522

DanKaplanSES opened this issue Oct 6, 2023 · 2 comments
Labels
closed: question A user misinterpretation or support question. No action required. Content:WebAPI Web API docs

Comments

@DanKaplanSES
Copy link
Contributor

DanKaplanSES commented Oct 6, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/setTimeout

What specific section or headline is this issue about?

setTimeout() global function

What information was incorrect, unhelpful, or incomplete?

I hesitate to say any of this is incorrect, unhelpful, or incomplete. Personally--and I mean this in general, not specific to MDN--I always struggle when I have a question like, "Is it possible to do x?" You can search and search for an answer, but until you find something definitive, your search will be inconclusive.

With that in mind, I have a few "Is it possible to do x with setTimeout?"` questions that could be documented:

  1. Is it possible to check the status of a setTimeout (e.g., waiting, complete, canceled)?
  2. Is it possible to attach a listener to a/all setTimeouts that dispatches when the timeout is completed?
  3. Is it possible to attach a listener to a/all setTimeouts that dispatches if the timeout is canceled?

These questions have permutations depending on whether or not the user can edit the code that uses setTimeout, can edit the functionRef, or can gain access to the timeoutID.

I want to be clear that I'm not asking for a "setTimeout Cookbook" section; those are the types of questions I would ask on stack overflow. Instead, I'm asking if this functionality is built into the standard library.

What did you expect to see?

To be honest, I wasn't necessarily expecting to see this until I noticed the plethora of detail in this page's subsections. I kept scrolling, hoping to find a setTimeout limitation section. Since I didn't find it, I figured I'd create an issue.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

I apologize this issue wastes anyone's time; I'm not confident it makes sense to answer these questions. Even if it does make sense to answer them, it may not belong on this page. It may not even belong on MDN. I had these questions and I wished I could find the answers here, but that's just my POV and experience. That doesn't mean it'll be anyone else's.

MDN metadata

Page report details
@DanKaplanSES DanKaplanSES added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Oct 6, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 6, 2023
@Lymah123
Copy link

Lymah123 commented Oct 8, 2023

Hi, can I work on it.

@caugner
Copy link
Contributor

caugner commented Nov 2, 2023

Is it possible to check the status of a setTimeout (e.g., waiting, complete, canceled)?
Is it possible to attach a listener to a/all setTimeouts that dispatches when the timeout is completed?
Is it possible to attach a listener to a/all setTimeouts that dispatches if the timeout is canceled?

I would recommend taking a look at the corresponding section of the HTML Standard linked in the Specifications section, if you want to double-check that MDN isn't missing a use case.

hoping to find a setTimeout limitation section.

Everything setTimeout provides is essentially contained in the Syntax section, especially the Return value subsection. All it mentions is that you can clear the timer, so it is fair to assume that you cannot do anything else with it, such as what you asked. You would need to implement the mentioned functionality yourself, or find a library that provides these.

I'm asking if this functionality is built into the standard library.

Please note that web feature suggestions are outside of the scope of MDN and this issue tracker, so I will go ahead and close this issue.

@caugner caugner closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2023
@caugner caugner added closed: question A user misinterpretation or support question. No action required. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question A user misinterpretation or support question. No action required. Content:WebAPI Web API docs
Projects
None yet
Development

No branches or pull requests

3 participants