code: function Machine(initialState, transitions, stateActions) {
      Pusher.EventsDispatcher.call(this);
  
      this.state = undefined;
      this.errors = [];
  
      // functions for each state
      this.stateActions = stateActions;
  
      // set up the transitions
      this.transitions = transitions;
  
      this.transition(initialState);
    }
docs: /*-----------------------------------------------
  The State Machine
  -----------------------------------------------