{"action":"created","issue":{"url":"https://api.github.com/repos/yortus/asyncawait/issues/39","repository_url":"https://api.github.com/repos/yortus/asyncawait","labels_url":"https://api.github.com/repos/yortus/asyncawait/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/yortus/asyncawait/issues/39/comments","events_url":"https://api.github.com/repos/yortus/asyncawait/issues/39/events","html_url":"https://github.com/yortus/asyncawait/pull/39","id":153398472,"number":39,"title":"add global feature","user":{"login":"2yuri","id":13418829,"avatar_url":"https://avatars.githubusercontent.com/u/13418829?v=3","gravatar_id":"","url":"https://api.github.com/users/2yuri","html_url":"https://github.com/2yuri","followers_url":"https://api.github.com/users/2yuri/followers","following_url":"https://api.github.com/users/2yuri/following{/other_user}","gists_url":"https://api.github.com/users/2yuri/gists{/gist_id}","starred_url":"https://api.github.com/users/2yuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2yuri/subscriptions","organizations_url":"https://api.github.com/users/2yuri/orgs","repos_url":"https://api.github.com/users/2yuri/repos","events_url":"https://api.github.com/users/2yuri/events{/privacy}","received_events_url":"https://api.github.com/users/2yuri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T07:58:36Z","updated_at":"2016-06-07T03:18:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yortus/asyncawait/pulls/39","html_url":"https://github.com/yortus/asyncawait/pull/39","diff_url":"https://github.com/yortus/asyncawait/pull/39.diff","patch_url":"https://github.com/yortus/asyncawait/pull/39.patch"},"body":"Use the convenience script global.js to make it works more like a language feature.\r\n\r\nExample:\r\n\r\n```javascript\r\nrequire('asyncawait/global');\r\n\r\nvar somethingAsync = async (function(){\r\n  var result = await (callAsync())\r\n  return result;\r\n});\r\n```\r\n\r\nPs: ignore the comit of readme.md, it does none changes indeed.\r\n"},"comment":{"url":"https://api.github.com/repos/yortus/asyncawait/issues/comments/224159648","html_url":"https://github.com/yortus/asyncawait/pull/39#issuecomment-224159648","issue_url":"https://api.github.com/repos/yortus/asyncawait/issues/39","id":224159648,"user":{"login":"yortus","id":1252361,"avatar_url":"https://avatars.githubusercontent.com/u/1252361?v=3","gravatar_id":"","url":"https://api.github.com/users/yortus","html_url":"https://github.com/yortus","followers_url":"https://api.github.com/users/yortus/followers","following_url":"https://api.github.com/users/yortus/following{/other_user}","gists_url":"https://api.github.com/users/yortus/gists{/gist_id}","starred_url":"https://api.github.com/users/yortus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yortus/subscriptions","organizations_url":"https://api.github.com/users/yortus/orgs","repos_url":"https://api.github.com/users/yortus/repos","events_url":"https://api.github.com/users/yortus/events{/privacy}","received_events_url":"https://api.github.com/users/yortus/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T03:18:14Z","updated_at":"2016-06-07T03:18:14Z","body":"Hi @2yuri, \r\n\r\nSorry for the delay - I've been flat out with other work.\r\n\r\nI use this approach myself, but so far I've been on the fence about adding it directly into the library.\r\n\r\nThe problem is that some library, say `fooLib`, sees this 'sanctioned' feature in asyncawait and uses it in it's own code. However, `fooLib` is just a library, and things that depend on `fooLib`, such as `thisApp` and `thatApp` get global pollution without asking for it or even knowing about it.\r\n\r\nIf a top-level application wants to change it's globals, that's fine, and it's only two lines of added code in the main module. However I don't think libraries should do this, or provide convenience functions for other libraries to do it, since they don't own the global namespace and therefore probably shouldn't touch it.\r\n\r\nAs such I'm inclined to keep this out of the library, whilst still encouraging you to set `async` and `await` as globals at your app-level in your own projects.\r\n\r\nI'll keep this open for now as you may have a good counterargument that I haven't considered.\r\n\r\n"}}
{"actor":{"display_login":"yortus"}}