Signature
tsSignature
export function all<const B extends BehaviorRecord>( behaviors: B, options?: { concurrency?: number },): Behavior<RecordInput<B>, OutputRecord<B>, ErrorUnion<B>, RecordContext<B>>;Imports
tsImport
import { all } from "@/lib/flow/all";import { all } from "@/lib/flow";Type Parameters
BBehavior record type.
Parameters
options{ concurrency?: number }
Optional concurrency limit.
Returns
A behavior producing a keyed output record or the first child error.
Return type
Behavior<RecordInput<B>, OutputRecord<B>, ErrorUnion<B>, RecordContext<B>>Details
Successful output preserves the input object keys. When a child fails, active siblings are
aborted and the first domain or runtime error is returned.
Examples
tsExample
const loadPage = all({ profile: loadProfile, settings: loadSettings,});Related Symbols
Behavior
Executable Flow workflow unit.
type
BehaviorRecord
Object map of named behaviors for `all`, `allSettled`, and `race`.
type
ErrorUnion
Unions the expected domain error types of every behavior in a record.
type
input
Creates an identity behavior for starting typed pipelines.
function
OutputRecord
Maps each behavior key to its successful output type.
type
RecordContext
Intersects the custom context types of every behavior in a record.
type
RecordInput
Intersects the input types of every behavior in a record.
type
Source
tsflow/all.ts:40-51
export function all<const B extends BehaviorRecord>( behaviors: B, options?: { concurrency?: number },): Behavior<RecordInput<B>, OutputRecord<B>, ErrorUnion<B>, RecordContext<B>> { return async (input, context) => { if (context.signal.aborted) { return resultFromSignal(context.signal); }
return runAll(behaviors, input, context, options?.concurrency); };}