Skip to content

Function: validateStateExists()

Documentation / @xmachines/play-router / validateStateExists

function validateStateExists(stateId, stateMap): void;

Defined in: validate-routes.ts:32

Validate state exists in state map

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

Parameters

ParameterTypeDescription
stateIdstringState identifier to validate
stateMapMap<string, StateNode<MachineContext, EventObject>>Map of all state IDs to StateNodes

Returns

void

Throws

If state ID doesn’t exist in map