{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2","id":69239481,"html_url":"https://github.com/SimonSchick/promise-waitfor/pull/2","diff_url":"https://github.com/SimonSchick/promise-waitfor/pull/2.diff","patch_url":"https://github.com/SimonSchick/promise-waitfor/pull/2.patch","issue_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/2","number":2,"state":"open","locked":false,"title":"Add pre-baked method with global Promise","user":{"login":"bfred-it","id":1402241,"avatar_url":"https://avatars.githubusercontent.com/u/1402241?v=3","gravatar_id":"","url":"https://api.github.com/users/bfred-it","html_url":"https://github.com/bfred-it","followers_url":"https://api.github.com/users/bfred-it/followers","following_url":"https://api.github.com/users/bfred-it/following{/other_user}","gists_url":"https://api.github.com/users/bfred-it/gists{/gist_id}","starred_url":"https://api.github.com/users/bfred-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfred-it/subscriptions","organizations_url":"https://api.github.com/users/bfred-it/orgs","repos_url":"https://api.github.com/users/bfred-it/repos","events_url":"https://api.github.com/users/bfred-it/events{/privacy}","received_events_url":"https://api.github.com/users/bfred-it/received_events","type":"User","site_admin":false},"body":"Don't pull this in yet, it'd be nice to have it for 2.0. It's especially nice for usage with ES modules. Currently:\r\n\r\n```js\r\nimport waitForGenerator from 'promise-waitfor`;\r\nconst waitFor = waitForGenerator();\r\nwaitFor(...).then(...);\r\n```\r\n\r\nWith this PR:\r\n\r\n```js\r\nimport {waitFor} from 'promise-waitfor`;\r\n// or\r\nconst waitFor = require('promise-waitfor`).waitFor;\r\n\r\nwaitFor(...).then(...);\r\n```\r\n\r\nBut perhaps it'd be better to have the global `Promise` as the default export, and let the developer use a custom implementation. I didn't submit it because it changes the API and depends on #1 \r\n\r\n```js\r\nconst waitFor = require('promise-waitfor`); // already usable with global.Promise\r\nwaitFor(...).then(...);\r\n```\r\n\r\nOr:\r\n\r\n```js\r\nconst Promise = require('bluebird').Promise\r\nconst waitFor = require('promise-waitfor`).use(Promise);\r\nwaitFor(...).then(...);\r\n```","created_at":"2016-05-07T10:42:40Z","updated_at":"2016-05-07T10:42:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2/commits","review_comments_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2/comments","review_comment_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/2/comments","statuses_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/statuses/166de64b8e01c6421bd179bfecbb76db8be76e58","head":{"label":"bfred-it:pre-baked-global-promise","ref":"pre-baked-global-promise","sha":"166de64b8e01c6421bd179bfecbb76db8be76e58","user":{"login":"bfred-it","id":1402241,"avatar_url":"https://avatars.githubusercontent.com/u/1402241?v=3","gravatar_id":"","url":"https://api.github.com/users/bfred-it","html_url":"https://github.com/bfred-it","followers_url":"https://api.github.com/users/bfred-it/followers","following_url":"https://api.github.com/users/bfred-it/following{/other_user}","gists_url":"https://api.github.com/users/bfred-it/gists{/gist_id}","starred_url":"https://api.github.com/users/bfred-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfred-it/subscriptions","organizations_url":"https://api.github.com/users/bfred-it/orgs","repos_url":"https://api.github.com/users/bfred-it/repos","events_url":"https://api.github.com/users/bfred-it/events{/privacy}","received_events_url":"https://api.github.com/users/bfred-it/received_events","type":"User","site_admin":false},"repo":{"id":58209854,"name":"promise-waitfor","full_name":"bfred-it/promise-waitfor","owner":{"login":"bfred-it","id":1402241,"avatar_url":"https://avatars.githubusercontent.com/u/1402241?v=3","gravatar_id":"","url":"https://api.github.com/users/bfred-it","html_url":"https://github.com/bfred-it","followers_url":"https://api.github.com/users/bfred-it/followers","following_url":"https://api.github.com/users/bfred-it/following{/other_user}","gists_url":"https://api.github.com/users/bfred-it/gists{/gist_id}","starred_url":"https://api.github.com/users/bfred-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfred-it/subscriptions","organizations_url":"https://api.github.com/users/bfred-it/orgs","repos_url":"https://api.github.com/users/bfred-it/repos","events_url":"https://api.github.com/users/bfred-it/events{/privacy}","received_events_url":"https://api.github.com/users/bfred-it/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bfred-it/promise-waitfor","description":"Promise polling utility","fork":true,"url":"https://api.github.com/repos/bfred-it/promise-waitfor","forks_url":"https://api.github.com/repos/bfred-it/promise-waitfor/forks","keys_url":"https://api.github.com/repos/bfred-it/promise-waitfor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bfred-it/promise-waitfor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bfred-it/promise-waitfor/teams","hooks_url":"https://api.github.com/repos/bfred-it/promise-waitfor/hooks","issue_events_url":"https://api.github.com/repos/bfred-it/promise-waitfor/issues/events{/number}","events_url":"https://api.github.com/repos/bfred-it/promise-waitfor/events","assignees_url":"https://api.github.com/repos/bfred-it/promise-waitfor/assignees{/user}","branches_url":"https://api.github.com/repos/bfred-it/promise-waitfor/branches{/branch}","tags_url":"https://api.github.com/repos/bfred-it/promise-waitfor/tags","blobs_url":"https://api.github.com/repos/bfred-it/promise-waitfor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bfred-it/promise-waitfor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bfred-it/promise-waitfor/git/refs{/sha}","trees_url":"https://api.github.com/repos/bfred-it/promise-waitfor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bfred-it/promise-waitfor/statuses/{sha}","languages_url":"https://api.github.com/repos/bfred-it/promise-waitfor/languages","stargazers_url":"https://api.github.com/repos/bfred-it/promise-waitfor/stargazers","contributors_url":"https://api.github.com/repos/bfred-it/promise-waitfor/contributors","subscribers_url":"https://api.github.com/repos/bfred-it/promise-waitfor/subscribers","subscription_url":"https://api.github.com/repos/bfred-it/promise-waitfor/subscription","commits_url":"https://api.github.com/repos/bfred-it/promise-waitfor/commits{/sha}","git_commits_url":"https://api.github.com/repos/bfred-it/promise-waitfor/git/commits{/sha}","comments_url":"https://api.github.com/repos/bfred-it/promise-waitfor/comments{/number}","issue_comment_url":"https://api.github.com/repos/bfred-it/promise-waitfor/issues/comments{/number}","contents_url":"https://api.github.com/repos/bfred-it/promise-waitfor/contents/{+path}","compare_url":"https://api.github.com/repos/bfred-it/promise-waitfor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bfred-it/promise-waitfor/merges","archive_url":"https://api.github.com/repos/bfred-it/promise-waitfor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bfred-it/promise-waitfor/downloads","issues_url":"https://api.github.com/repos/bfred-it/promise-waitfor/issues{/number}","pulls_url":"https://api.github.com/repos/bfred-it/promise-waitfor/pulls{/number}","milestones_url":"https://api.github.com/repos/bfred-it/promise-waitfor/milestones{/number}","notifications_url":"https://api.github.com/repos/bfred-it/promise-waitfor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bfred-it/promise-waitfor/labels{/name}","releases_url":"https://api.github.com/repos/bfred-it/promise-waitfor/releases{/id}","deployments_url":"https://api.github.com/repos/bfred-it/promise-waitfor/deployments","created_at":"2016-05-06T13:39:27Z","updated_at":"2016-05-06T13:39:29Z","pushed_at":"2016-05-07T10:35:45Z","git_url":"git://github.com/bfred-it/promise-waitfor.git","ssh_url":"git@github.com:bfred-it/promise-waitfor.git","clone_url":"https://github.com/bfred-it/promise-waitfor.git","svn_url":"https://github.com/bfred-it/promise-waitfor","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SimonSchick:master","ref":"master","sha":"33c306d63027108c38df134f9b24c23cfde3052a","user":{"login":"SimonSchick","id":3259089,"avatar_url":"https://avatars.githubusercontent.com/u/3259089?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSchick","html_url":"https://github.com/SimonSchick","followers_url":"https://api.github.com/users/SimonSchick/followers","following_url":"https://api.github.com/users/SimonSchick/following{/other_user}","gists_url":"https://api.github.com/users/SimonSchick/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSchick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSchick/subscriptions","organizations_url":"https://api.github.com/users/SimonSchick/orgs","repos_url":"https://api.github.com/users/SimonSchick/repos","events_url":"https://api.github.com/users/SimonSchick/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSchick/received_events","type":"User","site_admin":false},"repo":{"id":50271257,"name":"promise-waitfor","full_name":"SimonSchick/promise-waitfor","owner":{"login":"SimonSchick","id":3259089,"avatar_url":"https://avatars.githubusercontent.com/u/3259089?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonSchick","html_url":"https://github.com/SimonSchick","followers_url":"https://api.github.com/users/SimonSchick/followers","following_url":"https://api.github.com/users/SimonSchick/following{/other_user}","gists_url":"https://api.github.com/users/SimonSchick/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonSchick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonSchick/subscriptions","organizations_url":"https://api.github.com/users/SimonSchick/orgs","repos_url":"https://api.github.com/users/SimonSchick/repos","events_url":"https://api.github.com/users/SimonSchick/events{/privacy}","received_events_url":"https://api.github.com/users/SimonSchick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SimonSchick/promise-waitfor","description":"Promise polling utility","fork":false,"url":"https://api.github.com/repos/SimonSchick/promise-waitfor","forks_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/forks","keys_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/teams","hooks_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/hooks","issue_events_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/events{/number}","events_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/events","assignees_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/assignees{/user}","branches_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/branches{/branch}","tags_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/tags","blobs_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/git/refs{/sha}","trees_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/statuses/{sha}","languages_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/languages","stargazers_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/stargazers","contributors_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/contributors","subscribers_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/subscribers","subscription_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/subscription","commits_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/commits{/sha}","git_commits_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/git/commits{/sha}","comments_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/comments{/number}","issue_comment_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/comments{/number}","contents_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/contents/{+path}","compare_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/merges","archive_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/downloads","issues_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues{/number}","pulls_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls{/number}","milestones_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/milestones{/number}","notifications_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/labels{/name}","releases_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/releases{/id}","deployments_url":"https://api.github.com/repos/SimonSchick/promise-waitfor/deployments","created_at":"2016-01-24T03:57:55Z","updated_at":"2016-05-06T13:39:03Z","pushed_at":"2016-05-07T07:44:35Z","git_url":"git://github.com/SimonSchick/promise-waitfor.git","ssh_url":"git@github.com:SimonSchick/promise-waitfor.git","clone_url":"https://github.com/SimonSchick/promise-waitfor.git","svn_url":"https://github.com/SimonSchick/promise-waitfor","homepage":null,"size":6,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2"},"html":{"href":"https://github.com/SimonSchick/promise-waitfor/pull/2"},"issue":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/2"},"comments":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/SimonSchick/promise-waitfor/statuses/166de64b8e01c6421bd179bfecbb76db8be76e58"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":12,"deletions":2,"changed_files":2}}