{"action":"created","issue":{"url":"https://api.github.com/repos/rackt/redux/issues/1052","labels_url":"https://api.github.com/repos/rackt/redux/issues/1052/labels{/name}","comments_url":"https://api.github.com/repos/rackt/redux/issues/1052/comments","events_url":"https://api.github.com/repos/rackt/redux/issues/1052/events","html_url":"https://github.com/rackt/redux/pull/1052","id":117688321,"number":1052,"title":"Simplify applyMiddleware","user":{"login":"buunguyen","id":406631,"avatar_url":"https://avatars.githubusercontent.com/u/406631?v=3","gravatar_id":"","url":"https://api.github.com/users/buunguyen","html_url":"https://github.com/buunguyen","followers_url":"https://api.github.com/users/buunguyen/followers","following_url":"https://api.github.com/users/buunguyen/following{/other_user}","gists_url":"https://api.github.com/users/buunguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/buunguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buunguyen/subscriptions","organizations_url":"https://api.github.com/users/buunguyen/orgs","repos_url":"https://api.github.com/users/buunguyen/repos","events_url":"https://api.github.com/users/buunguyen/events{/privacy}","received_events_url":"https://api.github.com/users/buunguyen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-18T21:41:55Z","updated_at":"2015-11-18T23:49:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rackt/redux/pulls/1052","html_url":"https://github.com/rackt/redux/pull/1052","diff_url":"https://github.com/rackt/redux/pull/1052.diff","patch_url":"https://github.com/rackt/redux/pull/1052.patch"},"body":"The assignment `dispatch = store.dispatch` is essentially a no-op as `dispatch` is assigned to the result of `compose(..chain)(store.dispatch)`. This pull request removes the assignment to simplify the code and avoid confusion as to what the actual value of `dispatch` is by the time the middleware invokes it (I had that question myself when reading the source)."},"comment":{"url":"https://api.github.com/repos/rackt/redux/issues/comments/157901258","html_url":"https://github.com/rackt/redux/pull/1052#issuecomment-157901258","issue_url":"https://api.github.com/repos/rackt/redux/issues/1052","id":157901258,"user":{"login":"buunguyen","id":406631,"avatar_url":"https://avatars.githubusercontent.com/u/406631?v=3","gravatar_id":"","url":"https://api.github.com/users/buunguyen","html_url":"https://github.com/buunguyen","followers_url":"https://api.github.com/users/buunguyen/followers","following_url":"https://api.github.com/users/buunguyen/following{/other_user}","gists_url":"https://api.github.com/users/buunguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/buunguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buunguyen/subscriptions","organizations_url":"https://api.github.com/users/buunguyen/orgs","repos_url":"https://api.github.com/users/buunguyen/repos","events_url":"https://api.github.com/users/buunguyen/events{/privacy}","received_events_url":"https://api.github.com/users/buunguyen/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T23:49:16Z","updated_at":"2015-11-18T23:49:16Z","body":"If that was to make Flow happy instead of enabling a use case, would initially assign `dispatch` to a function that throws an error be better?  Basically replace line 22 with:\r\n\r\n```js\r\nvar dispatch = function () {\r\n  throw new Error('dispatch must not be invoked during middleware initialization')\r\n}\r\n```"}}