Hyperlinkv0.8.0-beta.28

Effect

Effect.abortSignalconsteffect/Effect.ts:7428
Effect<AbortSignal, never, Scope>

Creates an AbortSignal that is managed by the provided scope.

When to use

Use to obtain a scope-managed AbortSignal for APIs that accept cancellation through a signal.

Details

Each acquisition creates a fresh AbortController. Closing the owning scope runs a finalizer that aborts the controller and the effect succeeds with the controller's signal.

Gotchas

The signal is aborted when its owning scope closes, so avoid keeping it for work that outlives that scope.

interruptionscoped
Source effect/Effect.ts:74281 lines
export const abortSignal: Effect<AbortSignal, never, Scope> = internal.abortSignal