jakesgordon / javascript-state-machine

A javascript finite state machine library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GOTO - Changing State Without a Transition --> not working with factory

hosamshahin opened this issue · comments

Can anyone help me with that:

var FSM = StateMachine.factory({
  init: 'A',
  transitions: [{
    name: 'step',
    from: 'A',
    to: 'B'
  }, {
    name: 'step',
    from: 'B',
    to: 'C'
  }]
});

var fsm1 = new FSM();
fsm1.goto('B');

I'm getting the following error:
fsm1.goto('B');
^
TypeError: fsm1.goto is not a function

$ node -v
$ v8.2.0

Just a missing { name: 'goto', from: '*', to: function(s) { return s } }