Skip to main content

TaskContext

Defined in: js-api/src/u2core/scope.ts:12

What the function Scope.task runs gets: the run's abort signal, and the way back into its owner after an await.

Properties​

PropertyModifierTypeDescriptionDefined in
ownerreadonlyScopeThe scope the task runs for.js-api/src/u2core/scope.ts:16
signalreadonlyAbortSignalAborted when the owner is disposed or the run cancelled: hand it to fetch.js-api/src/u2core/scope.ts:14

Methods​

build()​

build<T>(fn): T | undefined

Defined in: js-api/src/u2core/scope.ts:19

Runs fn with the owner ambient, so what it builds is the owner's; once the owner is gone or the run cancelled, skips it and answers undefined.

Type Parameters​

Type Parameter
T

Parameters​

ParameterType
fn() => T

Returns​

T | undefined