Skip to content

machina.utils.getDefaultClientMeta

Jim Cowart edited this page Feb 2, 2015 · 1 revision

machina.utils.getDefaultClientMeta()

description: used internally to provide default values for machina.Fsm instances and also for clients of machina.BehavioralFsm instances.

returns: an object containing the following properties:

  • inputQueue - an array which is used to hold deferred input (populated when deferUntilTransition is called).
  • targetReplayState - Used while processing the inputQueue. It holds the string state name of the state which inputQueue items should be replayed in.
  • state - The string value of the current state of the FSM.
  • priorState - The string value of the previous state of the FSM.
  • priorAction - The name of the input which was last handled.
  • currentAction - The name of the input which is currently being handled.
  • currentActionArgs - The args provided to the current input being handled.
  • inExitHandler - Boolean which is set to true if the FSM is in the process of transitioning and is currently executing an _onExit handler.

Overriding getDefaultClientMeta is not recommended, as you will likely break machina's core behavior. However, extending it with additional properties you need on each FSM should be fine as long as the above values are left intact.