Skip to content

waygraph / composeBlock

Function: composeBlock() ​

Call Signature ​

composeBlock<In, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:76

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

Call Signature ​

composeBlock<In, B, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:81

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

B ​

B extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, B>, Block<B, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

Call Signature ​

composeBlock<In, B, C, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:87

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

B ​

B extends Checkpoint<string>

C ​

C extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, B>, Block<B, C>, Block<C, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

Call Signature ​

composeBlock<In, B, C, D, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:94

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

B ​

B extends Checkpoint<string>

C ​

C extends Checkpoint<string>

D ​

D extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, B>, Block<B, C>, Block<C, D>, Block<D, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

Call Signature ​

composeBlock<In, B, C, D, E, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:105

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

B ​

B extends Checkpoint<string>

C ​

C extends Checkpoint<string>

D ​

D extends Checkpoint<string>

E ​

E extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, B>, Block<B, C>, Block<C, D>, Block<D, E>, Block<E, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

Call Signature ​

composeBlock<In, B, C, D, E, F, Out>(name, steps): ComposedBlock<In, Out>

Defined in: src/engine/block/compose.ts:117

Chains several Blocks into one named, exported unit - what a naturally multi-step feature (a stepper form with several pages, say) wants instead of either one giant Block with no per-step confirmation, or several separately exported Blocks the caller has to wire together by hand every time. Each step keeps its own real act/resolve/verify, chained the same way connect() already chains any two Blocks - composeBlock is not a new execution mechanism, just connect() reduced over the list plus a name and the same step-list closure Flow already keeps for its own Block list, so withStepVerify/modStepVerify can patch one step from outside without the caller needing to hand-rebuild the chain. Resolution is by .name, not object identity, so a step reference stays valid even after an earlier patch swapped that slot for a new object - see Flow.withBlockVerify for the identical guarantee one level up. Each call returns a new composed Block; the original is untouched.

Type Parameters ​

In ​

In extends Checkpoint<string>

B ​

B extends Checkpoint<string>

C ​

C extends Checkpoint<string>

D ​

D extends Checkpoint<string>

E ​

E extends Checkpoint<string>

F ​

F extends Checkpoint<string>

Out ​

Out extends Checkpoint<string>

Parameters ​

name ​

string

steps ​

readonly [Block<In, B>, Block<B, C>, Block<C, D>, Block<D, E>, Block<E, F>, Block<F, Out>]

Returns ​

ComposedBlock<In, Out>

Example ​

ts
composeBlock("gov-form", [step1, step2, step3, step4])

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed