{"action":"created","issue":{"url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/12","labels_url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/12/comments","events_url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/12/events","html_url":"https://github.com/TehShrike/abstract-state-router/pull/12","id":56137158,"number":12,"title":"queue stateRouter.go() if the state is transitioning","user":{"login":"ArtskydJ","id":1833684,"avatar_url":"https://avatars.githubusercontent.com/u/1833684?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtskydJ","html_url":"https://github.com/ArtskydJ","followers_url":"https://api.github.com/users/ArtskydJ/followers","following_url":"https://api.github.com/users/ArtskydJ/following{/other_user}","gists_url":"https://api.github.com/users/ArtskydJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtskydJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtskydJ/subscriptions","organizations_url":"https://api.github.com/users/ArtskydJ/orgs","repos_url":"https://api.github.com/users/ArtskydJ/repos","events_url":"https://api.github.com/users/ArtskydJ/events{/privacy}","received_events_url":"https://api.github.com/users/ArtskydJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-31T20:00:52Z","updated_at":"2015-02-01T17:58:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TehShrike/abstract-state-router/pulls/12","html_url":"https://github.com/TehShrike/abstract-state-router/pull/12","diff_url":"https://github.com/TehShrike/abstract-state-router/pull/12.diff","patch_url":"https://github.com/TehShrike/abstract-state-router/pull/12.patch"},"body":"Thoughts?"},"comment":{"url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/comments/72375373","html_url":"https://github.com/TehShrike/abstract-state-router/pull/12#issuecomment-72375373","issue_url":"https://api.github.com/repos/TehShrike/abstract-state-router/issues/12","id":72375373,"user":{"login":"TehShrike","id":1141869,"avatar_url":"https://avatars.githubusercontent.com/u/1141869?v=3","gravatar_id":"","url":"https://api.github.com/users/TehShrike","html_url":"https://github.com/TehShrike","followers_url":"https://api.github.com/users/TehShrike/followers","following_url":"https://api.github.com/users/TehShrike/following{/other_user}","gists_url":"https://api.github.com/users/TehShrike/gists{/gist_id}","starred_url":"https://api.github.com/users/TehShrike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehShrike/subscriptions","organizations_url":"https://api.github.com/users/TehShrike/orgs","repos_url":"https://api.github.com/users/TehShrike/repos","events_url":"https://api.github.com/users/TehShrike/events{/privacy}","received_events_url":"https://api.github.com/users/TehShrike/received_events","type":"User","site_admin":false},"created_at":"2015-02-01T17:58:16Z","updated_at":"2015-02-01T17:58:16Z","body":"The implementation looks fine, but I'm starting to get antsy about adding more state to the StateProvider closure.  I wonder if it might be appropriate to start splitting things out to be more aggressively event-driven.\r\n\r\nLike, maybe breaking this out into two module thingies - one that's responsible for knowing whether or not the module is in the middle of a state transition, and another that's responsible for launching the queue-up-states?\r\n\r\nSo, something like this at the top of StateProvider:\r\n\r\n\tvar queueUpStateGo = stateQueueHandler(stateProviderEmitter)\r\n\tvar insideStateTransitionRightNow = stateTransitionWatcher(stateProviderEmitter)\r\n\r\nAnd then in state.go:\r\n\r\n\tif (insideStateTransitionRightNow()) {\r\n\t\tqueueUpStateGo(arguments)\r\n\t} else {\r\n\t\t// current contents of state.go\r\n\t}\r\n\r\nAnd then the state queue handler and transition watcher modules would just watch the emitter for state change start/end events to behave appropriately (the queue handler calling state.go on state change end, and the transition watcher just setting a boolean to true when a state change starts, and false when it ends).\r\n\r\nIt might seem a bit overengineered, but I think we're going to have to start fighting to keep the main closure clean."}}