Skip to content

Function: validateStateExists()

API / @xmachines/play-router / validateStateExists

function validateStateExists(stateId, stateIds): void;

Defined in: validate-routes.ts:31

Validate state exists in state ID set

Ensures referenced state IDs exist in the machine graph. Build-time validation prevents broken route references.

Parameters

ParameterTypeDescription
stateIdstringState identifier to validate
stateIdsSet<string>Set of all known state IDs from the machine graph

Returns

void

Throws

If state ID doesn’t exist in set