{"action":"created","comment":{"url":"https://api.github.com/repos/planetlabs/client/pulls/comments/222421056","pull_request_review_id":161303594,"id":222421056,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjQyMTA1Ng==","diff_hunk":"@@ -39,14 +40,29 @@ module.exports = function(config, key, each) {\n         // avoid fetching last empty page\n         done = data.length < pageSize;\n       }\n-      each(data);\n+\n       if (!aborted) {\n         var links = response.body._links || {};\n-        if (!done && links._next) {\n-          request\n-            .get({url: links._next, terminator: config.terminator})\n-            .then(handler)\n-            .catch(reject);\n+        var more = !done && !!links._next;\n+\n+        var next = !more\n+          ? function() {}\n+          : function() {\n+              request\n+                .get({url: links._next, terminator: config.terminator})\n+                .then(handler)\n+                .catch(reject);\n+          };\n+\n+        var keepGoing = !!each(data, more, next);\n+","path":"api/pager.js","position":33,"original_position":33,"commit_id":"123180dcb9e2a4d9c0132699e3a8caf41be70169","original_commit_id":"e66f9f8d4b0387a886dab096c5e4e851a3b0c9ae","user":{"login":"Jiert","id":590608,"node_id":"MDQ6VXNlcjU5MDYwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/590608?v=4","gravatar_id":"","url":"https://api.github.com/users/Jiert","html_url":"https://github.com/Jiert","followers_url":"https://api.github.com/users/Jiert/followers","following_url":"https://api.github.com/users/Jiert/following{/other_user}","gists_url":"https://api.github.com/users/Jiert/gists{/gist_id}","starred_url":"https://api.github.com/users/Jiert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jiert/subscriptions","organizations_url":"https://api.github.com/users/Jiert/orgs","repos_url":"https://api.github.com/users/Jiert/repos","events_url":"https://api.github.com/users/Jiert/events{/privacy}","received_events_url":"https://api.github.com/users/Jiert/received_events","type":"User","site_admin":false},"body":"good catch. ","created_at":"2018-10-03T18:36:01Z","updated_at":"2018-10-03T18:36:02Z","html_url":"https://github.com/planetlabs/client/pull/62#discussion_r222421056","pull_request_url":"https://api.github.com/repos/planetlabs/client/pulls/62","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/planetlabs/client/pulls/comments/222421056"},"html":{"href":"https://github.com/planetlabs/client/pull/62#discussion_r222421056"},"pull_request":{"href":"https://api.github.com/repos/planetlabs/client/pulls/62"}},"in_reply_to_id":222250687},"pull_request":{"url":"https://api.github.com/repos/planetlabs/client/pulls/62","id":219787296,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5Nzg3Mjk2","html_url":"https://github.com/planetlabs/client/pull/62","diff_url":"https://github.com/planetlabs/client/pull/62.diff","patch_url":"https://github.com/planetlabs/client/pull/62.patch","issue_url":"https://api.github.com/repos/planetlabs/client/issues/62","number":62,"state":"open","locked":false,"title":"Controlled paging","user":{"login":"Jiert","id":590608,"node_id":"MDQ6VXNlcjU5MDYwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/590608?v=4","gravatar_id":"","url":"https://api.github.com/users/Jiert","html_url":"https://github.com/Jiert","followers_url":"https://api.github.com/users/Jiert/followers","following_url":"https://api.github.com/users/Jiert/following{/other_user}","gists_url":"https://api.github.com/users/Jiert/gists{/gist_id}","starred_url":"https://api.github.com/users/Jiert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jiert/subscriptions","organizations_url":"https://api.github.com/users/Jiert/orgs","repos_url":"https://api.github.com/users/Jiert/repos","events_url":"https://api.github.com/users/Jiert/events{/privacy}","received_events_url":"https://api.github.com/users/Jiert/received_events","type":"User","site_admin":false},"body":"This PR allows adds the ability to provide a function for requesting the next page of features, rather than automatically requesting them.","created_at":"2018-10-02T17:39:26Z","updated_at":"2018-10-03T18:36:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a62b3ba87c1d884e350725b6349b54e5e493f49a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/planetlabs/client/pulls/62/commits","review_comments_url":"https://api.github.com/repos/planetlabs/client/pulls/62/comments","review_comment_url":"https://api.github.com/repos/planetlabs/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/planetlabs/client/issues/62/comments","statuses_url":"https://api.github.com/repos/planetlabs/client/statuses/123180dcb9e2a4d9c0132699e3a8caf41be70169","head":{"label":"planetlabs:controlled-paging","ref":"controlled-paging","sha":"123180dcb9e2a4d9c0132699e3a8caf41be70169","user":{"login":"planetlabs","id":5247016,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNDcwMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/5247016?v=4","gravatar_id":"","url":"https://api.github.com/users/planetlabs","html_url":"https://github.com/planetlabs","followers_url":"https://api.github.com/users/planetlabs/followers","following_url":"https://api.github.com/users/planetlabs/following{/other_user}","gists_url":"https://api.github.com/users/planetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/planetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetlabs/subscriptions","organizations_url":"https://api.github.com/users/planetlabs/orgs","repos_url":"https://api.github.com/users/planetlabs/repos","events_url":"https://api.github.com/users/planetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/planetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":37220164,"node_id":"MDEwOlJlcG9zaXRvcnkzNzIyMDE2NA==","name":"client","full_name":"planetlabs/client","private":false,"owner":{"login":"planetlabs","id":5247016,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNDcwMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/5247016?v=4","gravatar_id":"","url":"https://api.github.com/users/planetlabs","html_url":"https://github.com/planetlabs","followers_url":"https://api.github.com/users/planetlabs/followers","following_url":"https://api.github.com/users/planetlabs/following{/other_user}","gists_url":"https://api.github.com/users/planetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/planetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetlabs/subscriptions","organizations_url":"https://api.github.com/users/planetlabs/orgs","repos_url":"https://api.github.com/users/planetlabs/repos","events_url":"https://api.github.com/users/planetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/planetlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/planetlabs/client","description":"JavaScript client for the Planet imagery API ","fork":false,"url":"https://api.github.com/repos/planetlabs/client","forks_url":"https://api.github.com/repos/planetlabs/client/forks","keys_url":"https://api.github.com/repos/planetlabs/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/planetlabs/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/planetlabs/client/teams","hooks_url":"https://api.github.com/repos/planetlabs/client/hooks","issue_events_url":"https://api.github.com/repos/planetlabs/client/issues/events{/number}","events_url":"https://api.github.com/repos/planetlabs/client/events","assignees_url":"https://api.github.com/repos/planetlabs/client/assignees{/user}","branches_url":"https://api.github.com/repos/planetlabs/client/branches{/branch}","tags_url":"https://api.github.com/repos/planetlabs/client/tags","blobs_url":"https://api.github.com/repos/planetlabs/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/planetlabs/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/planetlabs/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/planetlabs/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/planetlabs/client/statuses/{sha}","languages_url":"https://api.github.com/repos/planetlabs/client/languages","stargazers_url":"https://api.github.com/repos/planetlabs/client/stargazers","contributors_url":"https://api.github.com/repos/planetlabs/client/contributors","subscribers_url":"https://api.github.com/repos/planetlabs/client/subscribers","subscription_url":"https://api.github.com/repos/planetlabs/client/subscription","commits_url":"https://api.github.com/repos/planetlabs/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/planetlabs/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/planetlabs/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/planetlabs/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/planetlabs/client/contents/{+path}","compare_url":"https://api.github.com/repos/planetlabs/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/planetlabs/client/merges","archive_url":"https://api.github.com/repos/planetlabs/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/planetlabs/client/downloads","issues_url":"https://api.github.com/repos/planetlabs/client/issues{/number}","pulls_url":"https://api.github.com/repos/planetlabs/client/pulls{/number}","milestones_url":"https://api.github.com/repos/planetlabs/client/milestones{/number}","notifications_url":"https://api.github.com/repos/planetlabs/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/planetlabs/client/labels{/name}","releases_url":"https://api.github.com/repos/planetlabs/client/releases{/id}","deployments_url":"https://api.github.com/repos/planetlabs/client/deployments","created_at":"2015-06-10T20:14:39Z","updated_at":"2018-06-05T08:38:32Z","pushed_at":"2018-10-03T18:34:58Z","git_url":"git://github.com/planetlabs/client.git","ssh_url":"git@github.com:planetlabs/client.git","clone_url":"https://github.com/planetlabs/client.git","svn_url":"https://github.com/planetlabs/client","homepage":"http://planetlabs.github.io/client/","size":967,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":17,"default_branch":"master"}},"base":{"label":"planetlabs:master","ref":"master","sha":"0783478e437708b35befd6566eed9f67c3e2f575","user":{"login":"planetlabs","id":5247016,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNDcwMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/5247016?v=4","gravatar_id":"","url":"https://api.github.com/users/planetlabs","html_url":"https://github.com/planetlabs","followers_url":"https://api.github.com/users/planetlabs/followers","following_url":"https://api.github.com/users/planetlabs/following{/other_user}","gists_url":"https://api.github.com/users/planetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/planetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetlabs/subscriptions","organizations_url":"https://api.github.com/users/planetlabs/orgs","repos_url":"https://api.github.com/users/planetlabs/repos","events_url":"https://api.github.com/users/planetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/planetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":37220164,"node_id":"MDEwOlJlcG9zaXRvcnkzNzIyMDE2NA==","name":"client","full_name":"planetlabs/client","private":false,"owner":{"login":"planetlabs","id":5247016,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyNDcwMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/5247016?v=4","gravatar_id":"","url":"https://api.github.com/users/planetlabs","html_url":"https://github.com/planetlabs","followers_url":"https://api.github.com/users/planetlabs/followers","following_url":"https://api.github.com/users/planetlabs/following{/other_user}","gists_url":"https://api.github.com/users/planetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/planetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetlabs/subscriptions","organizations_url":"https://api.github.com/users/planetlabs/orgs","repos_url":"https://api.github.com/users/planetlabs/repos","events_url":"https://api.github.com/users/planetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/planetlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/planetlabs/client","description":"JavaScript client for the Planet imagery API ","fork":false,"url":"https://api.github.com/repos/planetlabs/client","forks_url":"https://api.github.com/repos/planetlabs/client/forks","keys_url":"https://api.github.com/repos/planetlabs/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/planetlabs/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/planetlabs/client/teams","hooks_url":"https://api.github.com/repos/planetlabs/client/hooks","issue_events_url":"https://api.github.com/repos/planetlabs/client/issues/events{/number}","events_url":"https://api.github.com/repos/planetlabs/client/events","assignees_url":"https://api.github.com/repos/planetlabs/client/assignees{/user}","branches_url":"https://api.github.com/repos/planetlabs/client/branches{/branch}","tags_url":"https://api.github.com/repos/planetlabs/client/tags","blobs_url":"https://api.github.com/repos/planetlabs/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/planetlabs/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/planetlabs/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/planetlabs/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/planetlabs/client/statuses/{sha}","languages_url":"https://api.github.com/repos/planetlabs/client/languages","stargazers_url":"https://api.github.com/repos/planetlabs/client/stargazers","contributors_url":"https://api.github.com/repos/planetlabs/client/contributors","subscribers_url":"https://api.github.com/repos/planetlabs/client/subscribers","subscription_url":"https://api.github.com/repos/planetlabs/client/subscription","commits_url":"https://api.github.com/repos/planetlabs/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/planetlabs/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/planetlabs/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/planetlabs/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/planetlabs/client/contents/{+path}","compare_url":"https://api.github.com/repos/planetlabs/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/planetlabs/client/merges","archive_url":"https://api.github.com/repos/planetlabs/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/planetlabs/client/downloads","issues_url":"https://api.github.com/repos/planetlabs/client/issues{/number}","pulls_url":"https://api.github.com/repos/planetlabs/client/pulls{/number}","milestones_url":"https://api.github.com/repos/planetlabs/client/milestones{/number}","notifications_url":"https://api.github.com/repos/planetlabs/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/planetlabs/client/labels{/name}","releases_url":"https://api.github.com/repos/planetlabs/client/releases{/id}","deployments_url":"https://api.github.com/repos/planetlabs/client/deployments","created_at":"2015-06-10T20:14:39Z","updated_at":"2018-06-05T08:38:32Z","pushed_at":"2018-10-03T18:34:58Z","git_url":"git://github.com/planetlabs/client.git","ssh_url":"git@github.com:planetlabs/client.git","clone_url":"https://github.com/planetlabs/client.git","svn_url":"https://github.com/planetlabs/client","homepage":"http://planetlabs.github.io/client/","size":967,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/planetlabs/client/pulls/62"},"html":{"href":"https://github.com/planetlabs/client/pull/62"},"issue":{"href":"https://api.github.com/repos/planetlabs/client/issues/62"},"comments":{"href":"https://api.github.com/repos/planetlabs/client/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/planetlabs/client/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/planetlabs/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/planetlabs/client/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/planetlabs/client/statuses/123180dcb9e2a4d9c0132699e3a8caf41be70169"}},"author_association":"NONE"}}
{"actor":{"display_login":"Jiert"}}