jakesgordon / javascript-state-machine

A javascript finite state machine library
MIT License
8.69k stars 964 forks source link

Uncaught TypeError: fsm.transition is not a function #103

Closed madaono closed 7 years ago

madaono commented 7 years ago

hi ,i just send a ajax ,but the error happend and i dont know why. here is my code: function getLLotteryFollowPub(i) { $.get(getHost()+"/active/noactive",function (data) { JsObj = JSON.parse(data); ball.ltoken[i] = JsObj.ltoken; fsm.transition(); }); return StateMachine.ASYNC; }

thanks

jakesgordon commented 7 years ago

How is the function getLLotteryFollowPub attached to the state machine? In order to perform an ASYNC transition you should be returning StateMachine.ASYNC from a 'leave-state` callback.