{"action":"created","comment":{"url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/comments/42281892","id":42281892,"diff_hunk":"@@ -130,6 +146,70 @@ export class Page {\n   mapData(func) {\n     return new Page(this.data.map(func), this.before, this.after)\n   }\n+}\n+\n+/** Used to iterate over the pages of a query. */\n+export class PageIterator {\n+  /**\n+   * @param {Client} client\n+   * @param {number} opts.pageSize Number of elements in each page.\n+   * @param opts.mapLambda\n+   *   Mapping query (made by {@link lambda}) applied to each element of each page.\n+   * @param {function} opts.map\n+   *   Mapping JavaScript function used on each page element.\n+   */\n+  constructor(client, set, opts={}) {\n+    this.client = client\n+    this.set = set\n+    /** Set to `true` when there are no elements left to page through. */\n+    this.done = false\n+\n+    Object.assign(this, applyDefaults(opts, {\n+      pageSize: null,\n+      mapLambda: null,\n+      map: null\n+    }))\n \n-  // TODO: setIterator is async, so need a different way to do that...\n+    // Change nulls for pageSize to `undefined` because\n+    // `undefined` is automatically removed from queries by JSON.stringify.\n+    if (this.pageSize === null)\n+      this.pageSize = undefined\n+\n+    this.direction = undefined\n+    this.cursor = undefined\n+  }\n+\n+  /**\n+   * Moves this iterator to the next page and returns its data.\n+   * May set `this.done` to `true`.\n+   */\n+  async next() {","path":"src/objects.js","position":77,"original_position":77,"commit_id":"d0c343c6ccdf445068b650cdb1227c7665391abc","original_commit_id":"46720e044d7db7c09de92216db8e61e80edca89b","user":{"login":"eaceaser","id":157866,"avatar_url":"https://avatars.githubusercontent.com/u/157866?v=3","gravatar_id":"","url":"https://api.github.com/users/eaceaser","html_url":"https://github.com/eaceaser","followers_url":"https://api.github.com/users/eaceaser/followers","following_url":"https://api.github.com/users/eaceaser/following{/other_user}","gists_url":"https://api.github.com/users/eaceaser/gists{/gist_id}","starred_url":"https://api.github.com/users/eaceaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eaceaser/subscriptions","organizations_url":"https://api.github.com/users/eaceaser/orgs","repos_url":"https://api.github.com/users/eaceaser/repos","events_url":"https://api.github.com/users/eaceaser/events{/privacy}","received_events_url":"https://api.github.com/users/eaceaser/received_events","type":"User","site_admin":false},"body":"I'm not sure about the JS world, but modeling something simple after Scala's http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Stream probably would be fine","created_at":"2015-10-16T19:41:29Z","updated_at":"2015-10-16T19:41:29Z","html_url":"https://github.com/faunadb/faunadb-js/pull/4#discussion_r42281892","pull_request_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/comments/42281892"},"html":{"href":"https://github.com/faunadb/faunadb-js/pull/4#discussion_r42281892"},"pull_request":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4","id":47071487,"html_url":"https://github.com/faunadb/faunadb-js/pull/4","diff_url":"https://github.com/faunadb/faunadb-js/pull/4.diff","patch_url":"https://github.com/faunadb/faunadb-js/pull/4.patch","issue_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/4","number":4,"state":"open","locked":false,"title":"Model","user":{"login":"andy-faunadb","id":13004842,"avatar_url":"https://avatars.githubusercontent.com/u/13004842?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-faunadb","html_url":"https://github.com/andy-faunadb","followers_url":"https://api.github.com/users/andy-faunadb/followers","following_url":"https://api.github.com/users/andy-faunadb/following{/other_user}","gists_url":"https://api.github.com/users/andy-faunadb/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-faunadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-faunadb/subscriptions","organizations_url":"https://api.github.com/users/andy-faunadb/orgs","repos_url":"https://api.github.com/users/andy-faunadb/repos","events_url":"https://api.github.com/users/andy-faunadb/events{/privacy}","received_events_url":"https://api.github.com/users/andy-faunadb/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-07T19:33:36Z","updated_at":"2015-10-16T19:41:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9822f5c1fdb41646c608f98e5eaa2b1259ce283a","assignee":{"login":"eaceaser","id":157866,"avatar_url":"https://avatars.githubusercontent.com/u/157866?v=3","gravatar_id":"","url":"https://api.github.com/users/eaceaser","html_url":"https://github.com/eaceaser","followers_url":"https://api.github.com/users/eaceaser/followers","following_url":"https://api.github.com/users/eaceaser/following{/other_user}","gists_url":"https://api.github.com/users/eaceaser/gists{/gist_id}","starred_url":"https://api.github.com/users/eaceaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eaceaser/subscriptions","organizations_url":"https://api.github.com/users/eaceaser/orgs","repos_url":"https://api.github.com/users/eaceaser/repos","events_url":"https://api.github.com/users/eaceaser/events{/privacy}","received_events_url":"https://api.github.com/users/eaceaser/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4/commits","review_comments_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4/comments","review_comment_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/4/comments","statuses_url":"https://api.github.com/repos/faunadb/faunadb-js/statuses/d0c343c6ccdf445068b650cdb1227c7665391abc","head":{"label":"faunadb:model","ref":"model","sha":"d0c343c6ccdf445068b650cdb1227c7665391abc","user":{"login":"faunadb","id":1477000,"avatar_url":"https://avatars.githubusercontent.com/u/1477000?v=3","gravatar_id":"","url":"https://api.github.com/users/faunadb","html_url":"https://github.com/faunadb","followers_url":"https://api.github.com/users/faunadb/followers","following_url":"https://api.github.com/users/faunadb/following{/other_user}","gists_url":"https://api.github.com/users/faunadb/gists{/gist_id}","starred_url":"https://api.github.com/users/faunadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faunadb/subscriptions","organizations_url":"https://api.github.com/users/faunadb/orgs","repos_url":"https://api.github.com/users/faunadb/repos","events_url":"https://api.github.com/users/faunadb/events{/privacy}","received_events_url":"https://api.github.com/users/faunadb/received_events","type":"Organization","site_admin":false},"repo":{"id":43472750,"name":"faunadb-js","full_name":"faunadb/faunadb-js","owner":{"login":"faunadb","id":1477000,"avatar_url":"https://avatars.githubusercontent.com/u/1477000?v=3","gravatar_id":"","url":"https://api.github.com/users/faunadb","html_url":"https://github.com/faunadb","followers_url":"https://api.github.com/users/faunadb/followers","following_url":"https://api.github.com/users/faunadb/following{/other_user}","gists_url":"https://api.github.com/users/faunadb/gists{/gist_id}","starred_url":"https://api.github.com/users/faunadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faunadb/subscriptions","organizations_url":"https://api.github.com/users/faunadb/orgs","repos_url":"https://api.github.com/users/faunadb/repos","events_url":"https://api.github.com/users/faunadb/events{/privacy}","received_events_url":"https://api.github.com/users/faunadb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/faunadb/faunadb-js","description":"Node.js client for FaunaDB","fork":false,"url":"https://api.github.com/repos/faunadb/faunadb-js","forks_url":"https://api.github.com/repos/faunadb/faunadb-js/forks","keys_url":"https://api.github.com/repos/faunadb/faunadb-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/faunadb/faunadb-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/faunadb/faunadb-js/teams","hooks_url":"https://api.github.com/repos/faunadb/faunadb-js/hooks","issue_events_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/events{/number}","events_url":"https://api.github.com/repos/faunadb/faunadb-js/events","assignees_url":"https://api.github.com/repos/faunadb/faunadb-js/assignees{/user}","branches_url":"https://api.github.com/repos/faunadb/faunadb-js/branches{/branch}","tags_url":"https://api.github.com/repos/faunadb/faunadb-js/tags","blobs_url":"https://api.github.com/repos/faunadb/faunadb-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/faunadb/faunadb-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/faunadb/faunadb-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/faunadb/faunadb-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/faunadb/faunadb-js/statuses/{sha}","languages_url":"https://api.github.com/repos/faunadb/faunadb-js/languages","stargazers_url":"https://api.github.com/repos/faunadb/faunadb-js/stargazers","contributors_url":"https://api.github.com/repos/faunadb/faunadb-js/contributors","subscribers_url":"https://api.github.com/repos/faunadb/faunadb-js/subscribers","subscription_url":"https://api.github.com/repos/faunadb/faunadb-js/subscription","commits_url":"https://api.github.com/repos/faunadb/faunadb-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/faunadb/faunadb-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/faunadb/faunadb-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/faunadb/faunadb-js/contents/{+path}","compare_url":"https://api.github.com/repos/faunadb/faunadb-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/faunadb/faunadb-js/merges","archive_url":"https://api.github.com/repos/faunadb/faunadb-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/faunadb/faunadb-js/downloads","issues_url":"https://api.github.com/repos/faunadb/faunadb-js/issues{/number}","pulls_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls{/number}","milestones_url":"https://api.github.com/repos/faunadb/faunadb-js/milestones{/number}","notifications_url":"https://api.github.com/repos/faunadb/faunadb-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/faunadb/faunadb-js/labels{/name}","releases_url":"https://api.github.com/repos/faunadb/faunadb-js/releases{/id}","created_at":"2015-10-01T01:36:40Z","updated_at":"2015-10-05T21:32:03Z","pushed_at":"2015-10-16T19:29:06Z","git_url":"git://github.com/faunadb/faunadb-js.git","ssh_url":"git@github.com:faunadb/faunadb-js.git","clone_url":"https://github.com/faunadb/faunadb-js.git","svn_url":"https://github.com/faunadb/faunadb-js","homepage":null,"size":411,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"faunadb:master","ref":"master","sha":"06e6a9dab3a6fd98c9a769b7088753e65db4b83d","user":{"login":"faunadb","id":1477000,"avatar_url":"https://avatars.githubusercontent.com/u/1477000?v=3","gravatar_id":"","url":"https://api.github.com/users/faunadb","html_url":"https://github.com/faunadb","followers_url":"https://api.github.com/users/faunadb/followers","following_url":"https://api.github.com/users/faunadb/following{/other_user}","gists_url":"https://api.github.com/users/faunadb/gists{/gist_id}","starred_url":"https://api.github.com/users/faunadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faunadb/subscriptions","organizations_url":"https://api.github.com/users/faunadb/orgs","repos_url":"https://api.github.com/users/faunadb/repos","events_url":"https://api.github.com/users/faunadb/events{/privacy}","received_events_url":"https://api.github.com/users/faunadb/received_events","type":"Organization","site_admin":false},"repo":{"id":43472750,"name":"faunadb-js","full_name":"faunadb/faunadb-js","owner":{"login":"faunadb","id":1477000,"avatar_url":"https://avatars.githubusercontent.com/u/1477000?v=3","gravatar_id":"","url":"https://api.github.com/users/faunadb","html_url":"https://github.com/faunadb","followers_url":"https://api.github.com/users/faunadb/followers","following_url":"https://api.github.com/users/faunadb/following{/other_user}","gists_url":"https://api.github.com/users/faunadb/gists{/gist_id}","starred_url":"https://api.github.com/users/faunadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faunadb/subscriptions","organizations_url":"https://api.github.com/users/faunadb/orgs","repos_url":"https://api.github.com/users/faunadb/repos","events_url":"https://api.github.com/users/faunadb/events{/privacy}","received_events_url":"https://api.github.com/users/faunadb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/faunadb/faunadb-js","description":"Node.js client for FaunaDB","fork":false,"url":"https://api.github.com/repos/faunadb/faunadb-js","forks_url":"https://api.github.com/repos/faunadb/faunadb-js/forks","keys_url":"https://api.github.com/repos/faunadb/faunadb-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/faunadb/faunadb-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/faunadb/faunadb-js/teams","hooks_url":"https://api.github.com/repos/faunadb/faunadb-js/hooks","issue_events_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/events{/number}","events_url":"https://api.github.com/repos/faunadb/faunadb-js/events","assignees_url":"https://api.github.com/repos/faunadb/faunadb-js/assignees{/user}","branches_url":"https://api.github.com/repos/faunadb/faunadb-js/branches{/branch}","tags_url":"https://api.github.com/repos/faunadb/faunadb-js/tags","blobs_url":"https://api.github.com/repos/faunadb/faunadb-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/faunadb/faunadb-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/faunadb/faunadb-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/faunadb/faunadb-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/faunadb/faunadb-js/statuses/{sha}","languages_url":"https://api.github.com/repos/faunadb/faunadb-js/languages","stargazers_url":"https://api.github.com/repos/faunadb/faunadb-js/stargazers","contributors_url":"https://api.github.com/repos/faunadb/faunadb-js/contributors","subscribers_url":"https://api.github.com/repos/faunadb/faunadb-js/subscribers","subscription_url":"https://api.github.com/repos/faunadb/faunadb-js/subscription","commits_url":"https://api.github.com/repos/faunadb/faunadb-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/faunadb/faunadb-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/faunadb/faunadb-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/faunadb/faunadb-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/faunadb/faunadb-js/contents/{+path}","compare_url":"https://api.github.com/repos/faunadb/faunadb-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/faunadb/faunadb-js/merges","archive_url":"https://api.github.com/repos/faunadb/faunadb-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/faunadb/faunadb-js/downloads","issues_url":"https://api.github.com/repos/faunadb/faunadb-js/issues{/number}","pulls_url":"https://api.github.com/repos/faunadb/faunadb-js/pulls{/number}","milestones_url":"https://api.github.com/repos/faunadb/faunadb-js/milestones{/number}","notifications_url":"https://api.github.com/repos/faunadb/faunadb-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/faunadb/faunadb-js/labels{/name}","releases_url":"https://api.github.com/repos/faunadb/faunadb-js/releases{/id}","created_at":"2015-10-01T01:36:40Z","updated_at":"2015-10-05T21:32:03Z","pushed_at":"2015-10-16T19:29:06Z","git_url":"git://github.com/faunadb/faunadb-js.git","ssh_url":"git@github.com:faunadb/faunadb-js.git","clone_url":"https://github.com/faunadb/faunadb-js.git","svn_url":"https://github.com/faunadb/faunadb-js","homepage":null,"size":411,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4"},"html":{"href":"https://github.com/faunadb/faunadb-js/pull/4"},"issue":{"href":"https://api.github.com/repos/faunadb/faunadb-js/issues/4"},"comments":{"href":"https://api.github.com/repos/faunadb/faunadb-js/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/faunadb/faunadb-js/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/faunadb/faunadb-js/statuses/d0c343c6ccdf445068b650cdb1227c7665391abc"}}}}