interface AbortSignal
implements EventTarget

A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.

Properties

readonly
aborted: boolean
[src]

Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.

readonly
reason: any
[src]
onabort: ((this: AbortSignal, ev: Event) => any) | null[src]

Methods

addEventListener<K extends keyof AbortSignalEventMap>(
type: K,
listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void
[src]
removeEventListener<K extends keyof AbortSignalEventMap>(
type: K,
listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void
[src]
throwIfAborted(): void[src]

Throws this AbortSignal's abort reason, if its AbortController has signaled to abort; otherwise, does nothing.

variable AbortSignal
{ prototype: AbortSignal; new (): AbortSignal; abort(reason?: any): AbortSignal; timeout(milliseconds: number): AbortSignal; }[src]