Skip to content
Version: xstate@5.0.0

State.can() method​

Determines whether sending the event will cause a non-forbidden transition to be selected, even if the transitions have no actions nor change the state value.

Signature:

can(event: TEvent): boolean;

Parameters​

ParameterTypeDescription
eventTEventThe event to test

Returns:

boolean

Whether the event will cause a transition