Kaizen
Browse modulesFormsforms/sharedFunctions

Function: findReachableStepsWithData()

function findReachableStepsWithData(__namedParameters: WalkProps & {
  getNextStepFromKey: (fromKey: string) => string | null;
}): Set<string>;

Defined in: shared/forms/dag.ts:89

Data-aware sibling of findReachableSteps. Walks from formStepKey following the caller-supplied resolver, collecting every step the user would actually visit given current data.

Use this for the single-page renderer's "hide unmet steps" gate: compose the resolver from the live form values + condition evaluator, then render only the fields belonging to the returned set.

Semantics where the resolver returns null:

  • If the current step has no outgoing transitions in the topology, it's a terminal — included, walk stops.
  • Otherwise we treat the path as truncated: the step is included (the user is "here") but downstream steps are not, since they depend on unfilled data. The single-page UI then waits for the user to fill the gating field, which re-runs this walk and reveals the next slice.

Parameters

ParameterType
__namedParametersWalkProps & { getNextStepFromKey: (fromKey: string) => string | null; }

Returns

Set<string>

On this page