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

[feature] Missing API: AbortSignal.timeout() #521

Open
fatso83 opened this issue Dec 11, 2024 · 0 comments
Open

[feature] Missing API: AbortSignal.timeout() #521

fatso83 opened this issue Dec 11, 2024 · 0 comments

Comments

@fatso83
Copy link
Contributor

fatso83 commented Dec 11, 2024

Ref the discussion in #418 (comment) we should implement a fake AbortSignal.timeout() in environments where it exists. This should return a Signal interface that will list the status and it should be possible to listen to events on that signal to know when it has finished:

 // Watch for 'abort' signals
    signal.addEventListener("abort", () => {
      // Stop the main operation
      // Reject the promise with the abort reason.
      reject(signal.reason);
    });

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

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

No branches or pull requests

1 participant