API Reference
StopCondition
type StopCondition = (ctx) => boolean | Promise<boolean>;Defined in: stop/conditions.types.ts:45
A predicate that decides whether the loop should stop after the current turn.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | StopContext | The per-turn snapshot of loop state. |
Returns
boolean | Promise<boolean>
true to stop the loop, false to continue.
Remarks
Returns (or resolves to) true to stop, false to continue. Conditions may
be sync or async. Compose them with the any, all, and
not combinators.