Note: the preferred way to create an event is with cjs.on.
cjs.on
An event that triggers FSM transitions, like a click or a timeout. guard creates events that only trigger when a condition holds.
guard
An event that fires when this one does, but only if filter returns a truthy value. If filter is a property name instead, the event's filter property must equal value.
filter
value
Optional
If the user clicks and `ready` is `true` cjs.on("click").guard(function() { return ready === true; }); Copy
If the user clicks and `ready` is `true` cjs.on("click").guard(function() { return ready === true; });
If the user presses the escape key cjs.on("keydown").guard("key", "Escape"); Copy
If the user presses the escape key cjs.on("keydown").guard("key", "Escape");
Note: the preferred way to create an event is with
cjs.on.An event that triggers FSM transitions, like a click or a timeout.
guardcreates events that only trigger when a condition holds.See
cjs.on