Documents injecute 1.x · Migrating from 0.x
Skip to content

Interface: AbortSignalLike ​

Defined in: src/utils/lifecycle.ts:27

The part of an AbortSignal the lifecycle uses, for environments whose types have no AbortSignal. Any AbortSignal is one.

Example ​

ts
const signal: AbortSignalLike = AbortSignal.timeout(25_000);

Properties ​

aborted ​

readonly aborted: boolean

Defined in: src/utils/lifecycle.ts:29

true once the signal has aborted.


reason ​

readonly reason: unknown

Defined in: src/utils/lifecycle.ts:31

Why the signal aborted.

Methods ​

addEventListener() ​

addEventListener(type, listener, options?): void

Defined in: src/utils/lifecycle.ts:33

Subscribes to the abort event.

Parameters ​

type ​

"abort"

listener ​

() => void

options? ​
once? ​

boolean

Returns ​

void


removeEventListener() ​

removeEventListener(type, listener): void

Defined in: src/utils/lifecycle.ts:39

Unsubscribes from the abort event.

Parameters ​

type ​

"abort"

listener ​

() => void

Returns ​

void

Released under the MIT License.