Skip to content

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

@fatso83

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

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