Skip to content

Function: validateStateExists()

API / @xmachines/play-router / validateStateExists

function validateStateExists(stateId, stateIds): void;

Defined in: validate-routes.ts:43

Checks that the set of the state IDs holds a state

The function requires each state ID of a reference in the machine graph. This check at the build time therefore stops a broken route reference.

Parameters

ParameterTypeDescription
stateIdstringThe identifier of the state to check
stateIdsSet<string>The set of every known state ID of the machine graph

Returns

void

Throws

When the set does not hold the state ID