step
The step() function records a named step in a flow. When includeDetails is enabled in F.run(), the collected step names are returned alongside the final result.
Interactive example
Syntax
typescript
function step<
GenericName extends string,
GenericOutput extends unknown = void
>(
name: GenericName,
theFunction?: () => GenericOutput
): Generator | AsyncGeneratorParameters
name: Step label stored in the execution details.theFunction: Optional callback executed after the step is emitted. Its result becomes the return value ofstep().
Return value
A generator yielding a step effect. It returns undefined when no callback is provided, otherwise returns the callback result.
