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
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
owner | readonly | Scope | The scope the task runs for. | js-api/src/u2core/scope.ts:16 |
signal | readonly | AbortSignal | Aborted 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
| Parameter | Type |
|---|---|
fn | () => T |
Returns
T | undefined