Skip to content

Proposal: Use AbortController instead of the whenClosed() api on open() #328

@rmja

Description

@rmja

I'm submitting a feature request

Current behavior:
The current interface for open() has a nested promise to allow for cancellation of the dialog and wait for the result.

Expected/desired behavior:
An example of the current proposal for AbortController for the use in fetch() is here:. A similar example for dialog.open() could be:

let controller = new AbortController();
let result = dialog.open<TResult>({/* the usual stuff */,abort: controller.signal})

// To cancel the dialog:
controller.abort();

// Otherwise:
let output = result.output; // is of type TResult

The AbortController is supported in the upcoming releases of Firefox and Edge.

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