Skip to content

struct

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

Defined in: Core/TaskResult.ts:221

Combines a record of TaskResults into a single TaskResult 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>

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