IgeFSM

Method: defineState

Defines a state with a name and a state definition.
defineState (String name, Object definition)
  • Stringname The name of the state to define.
  • Objectdefinition The state definition object.
Returns IgeFSM

Define a state

var fsm = new IgeFSM();

// Define an "idle" state
fsm.defineState('idle', {
    enter: function (data, completeCallback) {
        console.log('entered idle state');
        completeCallback();
    },
    exit: function (data, completeCallback) {
        console.log('exited idle state');
        completeCallback();
    }
});
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point