new State(theStateID)
Represents a State.
Parameters:
| Name | Type | Description |
|---|---|---|
theStateID |
String | Identifies the state. Must be unique in the containing state machine. |
- Source:
Members
-
#handler[event] :HSM.State~Handler|Array.<HSM.State~Handler>
-
Map of events to handlers. Either a single handler or an array of handlers can be given. The guard of each handler will be called until a guard returns true (or a handler doesn't have a guard). This handler will then be triggered.
Type:
- HSM.State~Handler | Array.<HSM.State~Handler>
- Source:
-
State#on_entry :HSM.State~EntryFunc
-
Type:
- Source:
-
State#on_exit :HSM.State~ExitFunc
-
Type:
- Source:
Type Definitions
-
ActionFunc(source, target, data)
-
An action function may be attached to any transition. It will be called after all exit handlers and before all entry handlers are called.
Parameters:
Name Type Description sourceHSM.State current state targetHSM.State next state dataevent parameters - Source:
- See:
-
- HSM.State~Handler action
-
EntryFunc(source, target, data)
-
Parameters:
Name Type Description sourceHSM.State state targetHSM.State state dataevent parameters - Source:
-
ExitFunc(source, target, data)
-
Parameters:
Name Type Description sourceHSM.State state targetHSM.State state dataevent parameters - Source:
-
GuardFunc(source, target, data)
-
A guard function may be attached to any transition. It will be called before the transition is fired. If it doesn't return true, the transition will be disabled for the current event.
Parameters:
Name Type Description sourceHSM.State current state targetHSM.State potential next state dataevent parameters - Source:
-
Handler
-
Type:
- Object
- Source:
Properties:
Name Type Attributes Description targetHSM.State target state guardHSM.State~GuardFunc <optional>
disables the transition unless returns true. actionHSM.State~ActionFunc <optional>
called after all state exit handlers and before any state entry handlers are called.