{"action":"created","issue":{"url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/77","labels_url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/77/comments","events_url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/77/events","html_url":"https://github.com/jakesgordon/javascript-state-machine/issues/77","id":65704568,"number":77,"title":"Callback not be called when transition to same state","user":{"login":"valaxy","id":3876105,"avatar_url":"https://avatars.githubusercontent.com/u/3876105?v=3","gravatar_id":"","url":"https://api.github.com/users/valaxy","html_url":"https://github.com/valaxy","followers_url":"https://api.github.com/users/valaxy/followers","following_url":"https://api.github.com/users/valaxy/following{/other_user}","gists_url":"https://api.github.com/users/valaxy/gists{/gist_id}","starred_url":"https://api.github.com/users/valaxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valaxy/subscriptions","organizations_url":"https://api.github.com/users/valaxy/orgs","repos_url":"https://api.github.com/users/valaxy/repos","events_url":"https://api.github.com/users/valaxy/events{/privacy}","received_events_url":"https://api.github.com/users/valaxy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-01T14:52:06Z","updated_at":"2015-04-01T15:05:25Z","closed_at":null,"body":"I meet the problem that described here https://github.com/jakesgordon/javascript-state-machine/issues/14\r\nI think the bug it's not completely repaired, please see the code below, it demonstrate what I mean.\r\n\r\n```javascript```\t\r\nvar count = 0\r\nvar fsm = StateMachine.create({\r\n\tinitial: 'hide',\r\n\tevents: [\r\n\t\t{name: 'open', from: 'hide', to: 'show'},\r\n\t\t{name: 'again', from: 'show', to: 'show'},\r\n\t\t{name: 'close', from: 'show', to: 'hide'}\r\n\t],\r\n\tcallbacks: {\r\n\t\tonentershow: function () {\r\n\t\t\tcount++\r\n\t\t}\r\n\t}\r\n})\r\nfsm.open()   // expect count++\r\nfsm.again()  // expect count++\r\nfsm.again()  // expect count++\r\nfsm.close()\r\nassert.equal(count, 3) // error as count == 1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/comments/88516967","html_url":"https://github.com/jakesgordon/javascript-state-machine/issues/77#issuecomment-88516967","issue_url":"https://api.github.com/repos/jakesgordon/javascript-state-machine/issues/77","id":88516967,"user":{"login":"valaxy","id":3876105,"avatar_url":"https://avatars.githubusercontent.com/u/3876105?v=3","gravatar_id":"","url":"https://api.github.com/users/valaxy","html_url":"https://github.com/valaxy","followers_url":"https://api.github.com/users/valaxy/followers","following_url":"https://api.github.com/users/valaxy/following{/other_user}","gists_url":"https://api.github.com/users/valaxy/gists{/gist_id}","starred_url":"https://api.github.com/users/valaxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valaxy/subscriptions","organizations_url":"https://api.github.com/users/valaxy/orgs","repos_url":"https://api.github.com/users/valaxy/repos","events_url":"https://api.github.com/users/valaxy/events{/privacy}","received_events_url":"https://api.github.com/users/valaxy/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T15:05:25Z","updated_at":"2015-04-01T15:05:25Z","body":"OK, I check the code which shows:\r\n```\r\nif (from === to) {\r\n    StateMachine.afterEvent(this, name, from, to, args);\r\n    return StateMachine.Result.NOTRANSITION;\r\n}\r\n```\r\nMaybe I should use onafterevent instead of onenterstate"}}