Skip to content

struct

struct<E, R>(fields): TaskResult<E, R>

Defined in: Core/TaskResult.ts:237

Combines a record of Task.Results into a single Task.Result of a record. Evaluates all tasks in parallel, forwarding the AbortSignal down to each sub-task. Returns the first Err encountered in key order.

E

R extends Record<string, any>

{ [K in string | number | symbol]: TaskResult<E, R[K]> }

TaskResult<E, R>

Task.Result.struct({
  name: Task.Result.ok("Alice"),
  age: Task.Result.ok(30)
}); // Task.Result({ name: "Alice", age: 30 })