Skip to content
Buy me a coffee

EnhancedSignal

Defined in: src/EnhancedAbortController.ts:11

The signal of an EnhancedAbortController: a real AbortSignal, with a few extras.

  • AbortSignal

readonly aborted: boolean

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2752

The aborted read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (true) or not (false).

MDN Reference

AbortSignal.aborted


readonly canBeAborted: boolean

Defined in: src/EnhancedAbortController.ts:17

Always true for a controller’s signal (see EnhancedAbortSignal.canBeAborted).


onabort: ((this, ev) => any) | null

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2754

MDN Reference

AbortSignal.onabort


readonly reason: any

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2760

The reason read-only property returns a JavaScript value that indicates the abort reason.

MDN Reference

AbortSignal.reason


readonly whenAborted: Promise<unknown>

Defined in: src/EnhancedAbortController.ts:15

Same as whenAborted(signal): resolves with the reason once the signal aborts.

addEventListener<K>(type, listener, options?): void

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2767

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

K extends "abort"

K

(this, ev) => any

boolean | AddEventListenerOptions

void

AbortSignal.addEventListener

addEventListener(type, listener, options?): void

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2768

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

string

EventListenerOrEventListenerObject

boolean | AddEventListenerOptions

void

AbortSignal.addEventListener


dispatchEvent(event): boolean

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:11575

The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

MDN Reference

Event

boolean

AbortSignal.dispatchEvent


register(callback): AbortRegistration

Defined in: src/EnhancedAbortController.ts:13

Same as register(signal, callback).

(reason) => void

AbortRegistration


removeEventListener<K>(type, listener, options?): void

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2769

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

MDN Reference

K extends "abort"

K

(this, ev) => any

boolean | EventListenerOptions

void

AbortSignal.removeEventListener

removeEventListener(type, listener, options?): void

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2770

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

MDN Reference

string

EventListenerOrEventListenerObject

boolean | EventListenerOptions

void

AbortSignal.removeEventListener


throwIfAborted(): void

Defined in: site/node_modules/typescript/lib/lib.dom.d.ts:2766

The throwIfAborted() method throws the signal’s abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing.

MDN Reference

void

AbortSignal.throwIfAborted