Special States + Aliases
@enter
An internal private state, which the state machine is in once constructed, but not started. This state should not be used within the SMGF.
@exit
An internal (public) state, representing the terminal state when the machine has exited normally (with no error). This will cause the state machine to emit an exit event, with the arguments set to the transition arguments set when '@exit' is entered.
If a callback has been assigned to the state machine (with either calling spawnWithCb, or by calling launch when a callback is defined within the SMGF defaults object) then the callback is called with arguments set to null followed by the transition arguments.
@error
An internal (public) state, representing the terminal state when the machine has exited with an error. This will cause the state machine to emit an error event, with the arguments set to the transition arguments set when '@error' is entered.
If a callback has been assigned to the state machine (with either calling spawnWithCb, or by calling launch when a callback is defined within the SMGF defaults object) then the callback is called with arguments set to the transition arguments (i.e. not prepended with null).
@self
A state alias - representing the current state. When '@self' is used then the state will be exited, the guard tested and then re-entered (if the guard passes), this is different to when an action returns a false value, when the state machine just remains in the state.
@ignore
An action alias - cause the matching event to be ignored, the machine remains in the current state.
@defer
An action alias - cause the matching event to be deferred by placing it on the deferred list. The deferred list is maintained betweens states with events remaining on the list until the machine enters a state which can handle them (the order in which the events arrive is maintained).
@next
A state alias - a State Behaviour Object can take a 'nextState' property, if this is set then '@next' uses this value to set the destination state.