Class: StateMachine

(abstract) sm.StateMachine()

Holds the the host object and the state of the host object. Runs the host object through the lifecycle according to the state machine definition. The root class for all SM classes.

Constructor

(abstract) new StateMachine()

Since:
  • 0.2.0
Source:

Methods

getState() → {string}

Returns the state of its corresponding host object.
Since:
  • 0.2.0
Source:
Returns:
the state of its corresponding host object
Type
string

init()

Starts the lifecycle of the host object, i.e. "pushes" the host object into the initial state of this state machine (and further from there).
Since:
  • 0.2.0
Source:
Throws:
Type
Error

process(trigger)

Executes the state machine according to the given trigger.
Parameters:
Name Type Description
trigger string event that triggers state machine execution
Since:
  • 0.2.0
Source:
Throws:
Type
Error