{"action":"created","issue":{"url":"https://api.github.com/repos/reddit/node-middleware/issues/1","repository_url":"https://api.github.com/repos/reddit/node-middleware","labels_url":"https://api.github.com/repos/reddit/node-middleware/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/reddit/node-middleware/issues/1/comments","events_url":"https://api.github.com/repos/reddit/node-middleware/issues/1/events","html_url":"https://github.com/reddit/node-middleware/pull/1","id":158406766,"number":1,"title":"Re-check the storequeue after the action is run","user":{"login":"ajacksified","id":175515,"avatar_url":"https://avatars.githubusercontent.com/u/175515?v=3","gravatar_id":"","url":"https://api.github.com/users/ajacksified","html_url":"https://github.com/ajacksified","followers_url":"https://api.github.com/users/ajacksified/followers","following_url":"https://api.github.com/users/ajacksified/following{/other_user}","gists_url":"https://api.github.com/users/ajacksified/gists{/gist_id}","starred_url":"https://api.github.com/users/ajacksified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajacksified/subscriptions","organizations_url":"https://api.github.com/users/ajacksified/orgs","repos_url":"https://api.github.com/users/ajacksified/repos","events_url":"https://api.github.com/users/ajacksified/events{/privacy}","received_events_url":"https://api.github.com/users/ajacksified/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-03T16:36:59Z","updated_at":"2016-06-03T16:38:36Z","closed_at":"2016-06-03T16:38:35Z","pull_request":{"url":"https://api.github.com/repos/reddit/node-middleware/pulls/1","html_url":"https://github.com/reddit/node-middleware/pull/1","diff_url":"https://github.com/reddit/node-middleware/pull/1.diff","patch_url":"https://github.com/reddit/node-middleware/pull/1.patch"},"body":"This solves an issue where an action is waitingForState, but the state change doesn't happen until the last action of a stack is fired. For example:\r\n\r\n1. say we had an action with something like `waitForState(state => state.loading === false);`\r\n2. N actions fire that don't touch `state.loading`\r\n3. one action, at the very end, sets `loading = false`\r\n\r\nBecause the storequeue was checked _before_ this last action, the waitForState predicate never evaluates to true and so the action which is waiting for `state.loading === false` is never dispatched.\r\n\r\nI copypasted this code, which should be written into a function instead of copypasted, to start discussion and confirm that this should be the intended behavior. This was causing odd behavior in a middleware I was writing that watched for `set_page`, and for `state.searchRequests[id].loading` to be false; the api response parsing was the last action fired in the stack, so the action never completed.\r\n\r\n👓 @schwers @nramadas "},"comment":{"url":"https://api.github.com/repos/reddit/node-middleware/issues/comments/223629291","html_url":"https://github.com/reddit/node-middleware/pull/1#issuecomment-223629291","issue_url":"https://api.github.com/repos/reddit/node-middleware/issues/1","id":223629291,"user":{"login":"ajacksified","id":175515,"avatar_url":"https://avatars.githubusercontent.com/u/175515?v=3","gravatar_id":"","url":"https://api.github.com/users/ajacksified","html_url":"https://github.com/ajacksified","followers_url":"https://api.github.com/users/ajacksified/followers","following_url":"https://api.github.com/users/ajacksified/following{/other_user}","gists_url":"https://api.github.com/users/ajacksified/gists{/gist_id}","starred_url":"https://api.github.com/users/ajacksified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajacksified/subscriptions","organizations_url":"https://api.github.com/users/ajacksified/orgs","repos_url":"https://api.github.com/users/ajacksified/repos","events_url":"https://api.github.com/users/ajacksified/events{/privacy}","received_events_url":"https://api.github.com/users/ajacksified/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T16:38:35Z","updated_at":"2016-06-03T16:38:35Z","body":"disregard, I was using an earlier version. this was just a practice pr"}}
{"actor":{"display_login":"ajacksified"}}