{"action":"created","issue":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/165","labels_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/165/comments","events_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/165/events","html_url":"https://github.com/KartikTalwar/gmail.js/pull/165","id":69049670,"number":165,"title":"Added async versions for make_request, visible_emails, email_data and email_source","user":{"login":"mzohreva","id":1142455,"avatar_url":"https://avatars.githubusercontent.com/u/1142455?v=3","gravatar_id":"","url":"https://api.github.com/users/mzohreva","html_url":"https://github.com/mzohreva","followers_url":"https://api.github.com/users/mzohreva/followers","following_url":"https://api.github.com/users/mzohreva/following{/other_user}","gists_url":"https://api.github.com/users/mzohreva/gists{/gist_id}","starred_url":"https://api.github.com/users/mzohreva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzohreva/subscriptions","organizations_url":"https://api.github.com/users/mzohreva/orgs","repos_url":"https://api.github.com/users/mzohreva/repos","events_url":"https://api.github.com/users/mzohreva/events{/privacy}","received_events_url":"https://api.github.com/users/mzohreva/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-17T02:35:50Z","updated_at":"2015-05-11T01:28:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/pulls/165","html_url":"https://github.com/KartikTalwar/gmail.js/pull/165","diff_url":"https://github.com/KartikTalwar/gmail.js/pull/165.diff","patch_url":"https://github.com/KartikTalwar/gmail.js/pull/165.patch"},"body":"I have made asynchronous versions of the following functions:\r\n* `make_request`\r\n* `visible_emails`\r\n* `email_data`\r\n* `email_source`\r\n\r\nThe async versions have the postfix **_async** in their names and take an additional argument called **callback** which will be called when the results are ready. The callback is passed a single argument which is the data that is normally returned by the synchronous version of the function.\r\n\r\nI checked the code and found that the following functions depend on `make_request` either directly or indirectly:\r\n* `api.get.visible_emails`\r\n* `api.get.email_data`\r\n* `api.get.email_source`\r\n* `api.get.selected_emails_data`\r\n* `api.get.displayed_email_data`\r\n* `api.dom.email.prototype.data`\r\n* `api.get.email_ids`\r\n* `api.dom.email.prototype.source`\r\n* `api.check.is_thread`\r\n\r\nI have added async versions for the first 3 functions listed above and if people like the idea, they can add async versions for the rest as well. I really only needed `email_data` for my own project.\r\n\r\nUsing the async versions improves the responsiveness of the user interface, especially if you use any of these functions in event handlers for events like *view_thread* or *view_email*"},"comment":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/comments/100731821","html_url":"https://github.com/KartikTalwar/gmail.js/pull/165#issuecomment-100731821","issue_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/165","id":100731821,"user":{"login":"KartikTalwar","id":461702,"avatar_url":"https://avatars.githubusercontent.com/u/461702?v=3","gravatar_id":"","url":"https://api.github.com/users/KartikTalwar","html_url":"https://github.com/KartikTalwar","followers_url":"https://api.github.com/users/KartikTalwar/followers","following_url":"https://api.github.com/users/KartikTalwar/following{/other_user}","gists_url":"https://api.github.com/users/KartikTalwar/gists{/gist_id}","starred_url":"https://api.github.com/users/KartikTalwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KartikTalwar/subscriptions","organizations_url":"https://api.github.com/users/KartikTalwar/orgs","repos_url":"https://api.github.com/users/KartikTalwar/repos","events_url":"https://api.github.com/users/KartikTalwar/events{/privacy}","received_events_url":"https://api.github.com/users/KartikTalwar/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T01:28:34Z","updated_at":"2015-05-11T01:28:34Z","body":"I'm reviewing a few outstanding issues so hopefully this will be merged\ntonight. Sorry for the delay\n\nOn Sunday, May 10, 2015, Oliver Nassar <notifications@github.com> wrote:\n\n> Would love to make use of this pull if it's up-to-par\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/KartikTalwar/gmail.js/pull/165#issuecomment-100731598>\n> .\n>\n"}}