{"action":"created","issue":{"url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/8","repository_url":"https://api.github.com/repos/MitMaro/node-server-shutdown","labels_url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/8/comments","events_url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/8/events","html_url":"https://github.com/MitMaro/node-server-shutdown/pull/8","id":184120279,"number":8,"title":"Reverse arguments to ServerShutdown#shutdown","user":{"login":"whymarrh","id":1623628,"avatar_url":"https://avatars.githubusercontent.com/u/1623628?v=3","gravatar_id":"","url":"https://api.github.com/users/whymarrh","html_url":"https://github.com/whymarrh","followers_url":"https://api.github.com/users/whymarrh/followers","following_url":"https://api.github.com/users/whymarrh/following{/other_user}","gists_url":"https://api.github.com/users/whymarrh/gists{/gist_id}","starred_url":"https://api.github.com/users/whymarrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whymarrh/subscriptions","organizations_url":"https://api.github.com/users/whymarrh/orgs","repos_url":"https://api.github.com/users/whymarrh/repos","events_url":"https://api.github.com/users/whymarrh/events{/privacy}","received_events_url":"https://api.github.com/users/whymarrh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-20T02:28:17Z","updated_at":"2016-10-20T14:38:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MitMaro/node-server-shutdown/pulls/8","html_url":"https://github.com/MitMaro/node-server-shutdown/pull/8","diff_url":"https://github.com/MitMaro/node-server-shutdown/pull/8.diff","patch_url":"https://github.com/MitMaro/node-server-shutdown/pull/8.patch"},"body":"This PR reverses the arguments to `ServerShutdown#shutdown`, putting the callback first and the flag 2nd.\r\n\r\nThere are a few things to this:\r\n\r\n1. This optimizes for the common uses cases, e.g.\r\n    - `foo.shutdown();`\r\n    - `foo.shutdown(() => {});`\r\n    - `foo.bind(foo, () => {});`\r\n2. This API is similar to the [`target.addEventListener(type, listener[, useCapture]);`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) which also relegates a lesser-used flag to the last argument\r\n3. Least importantly, this allows the use of [ES6 default parameters](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Default_parameters)"},"comment":{"url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/comments/255124739","html_url":"https://github.com/MitMaro/node-server-shutdown/pull/8#issuecomment-255124739","issue_url":"https://api.github.com/repos/MitMaro/node-server-shutdown/issues/8","id":255124739,"user":{"login":"whymarrh","id":1623628,"avatar_url":"https://avatars.githubusercontent.com/u/1623628?v=3","gravatar_id":"","url":"https://api.github.com/users/whymarrh","html_url":"https://github.com/whymarrh","followers_url":"https://api.github.com/users/whymarrh/followers","following_url":"https://api.github.com/users/whymarrh/following{/other_user}","gists_url":"https://api.github.com/users/whymarrh/gists{/gist_id}","starred_url":"https://api.github.com/users/whymarrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whymarrh/subscriptions","organizations_url":"https://api.github.com/users/whymarrh/orgs","repos_url":"https://api.github.com/users/whymarrh/repos","events_url":"https://api.github.com/users/whymarrh/events{/privacy}","received_events_url":"https://api.github.com/users/whymarrh/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T14:38:24Z","updated_at":"2016-10-20T14:38:24Z","body":"> Perhaps a better solution would be to remove the force flag and provide two function, `shutdown(callback)` and `forceShutdown(callback)`.\r\n\r\nThat's an even better idea!"}}
{"actor":{"display_login":"whymarrh"}}