Skip to content

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

Description

@fatso83

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions