{"action":"created","comment":{"url":"https://api.github.com/repos/ericelliott/object-list/pulls/comments/27849241","id":27849241,"diff_hunk":"@@ -42,21 +76,42 @@ var\n     return cWhere (collection, predicates);\n   };\n \n-var objectList = function objectList (collection) {\n-  return {\n-    getByKey: function (key) {\n-      return getByKey.apply(null, [collection, key]);\n-    },\n-    whitelist: function (keyWhitelist) {\n-      return whitelist.apply(null, [collection, keyWhitelist]);\n-    },\n-    concat: function () {\n-      return concat(collection);\n-    },\n-    where: function (keyWhitelist) {\n-      return where.apply(null, [collection, keyWhitelist]);\n-    },\n-  };\n+objectList = function objectList (options) {\n+  var\n+    collection,\n+    api = {\n+      getByKey: function (key) {\n+        return getByKey.apply(null, [collection, key]);\n+      },\n+      whitelist: function (keyWhitelist) {\n+        return whitelist.apply(null, [collection, keyWhitelist]);\n+      },\n+      concat: function () {\n+        return concat(collection);\n+      },\n+      where: function (keyWhitelist) {\n+        return where.apply(null, [collection, keyWhitelist]);\n+      },\n+      add: function (records) {\n+        return add.apply(null, [collection, records]);\n+      },\n+      push: function () {\n+        return api.add.apply(null, [].slice.call(arguments));\n+      },\n+      get length () {\n+        return collection.length;\n+      }\n+    };\n+\n+  if (options.async) {\n+    collection = options.list;\n+\n+    api.add = addAsync.bind(null, collection);","path":"index.js","position":104,"original_position":104,"commit_id":"ff48dd5428e7e2c56b52eb9ef94def3ebcbb0764","original_commit_id":"ff48dd5428e7e2c56b52eb9ef94def3ebcbb0764","user":{"login":"therealklanni","id":626347,"avatar_url":"https://avatars.githubusercontent.com/u/626347?v=3","gravatar_id":"","url":"https://api.github.com/users/therealklanni","html_url":"https://github.com/therealklanni","followers_url":"https://api.github.com/users/therealklanni/followers","following_url":"https://api.github.com/users/therealklanni/following{/other_user}","gists_url":"https://api.github.com/users/therealklanni/gists{/gist_id}","starred_url":"https://api.github.com/users/therealklanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealklanni/subscriptions","organizations_url":"https://api.github.com/users/therealklanni/orgs","repos_url":"https://api.github.com/users/therealklanni/repos","events_url":"https://api.github.com/users/therealklanni/events{/privacy}","received_events_url":"https://api.github.com/users/therealklanni/received_events","type":"User","site_admin":false},"body":"I'm open to suggestions :)","created_at":"2015-04-07T03:22:04Z","updated_at":"2015-04-07T03:22:04Z","html_url":"https://github.com/ericelliott/object-list/pull/7#discussion_r27849241","pull_request_url":"https://api.github.com/repos/ericelliott/object-list/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/comments/27849241"},"html":{"href":"https://github.com/ericelliott/object-list/pull/7#discussion_r27849241"},"pull_request":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/ericelliott/object-list/pulls/7","id":32626263,"html_url":"https://github.com/ericelliott/object-list/pull/7","diff_url":"https://github.com/ericelliott/object-list/pull/7.diff","patch_url":"https://github.com/ericelliott/object-list/pull/7.patch","issue_url":"https://api.github.com/repos/ericelliott/object-list/issues/7","number":7,"state":"open","locked":false,"title":"Add `.add()` method","user":{"login":"therealklanni","id":626347,"avatar_url":"https://avatars.githubusercontent.com/u/626347?v=3","gravatar_id":"","url":"https://api.github.com/users/therealklanni","html_url":"https://github.com/therealklanni","followers_url":"https://api.github.com/users/therealklanni/followers","following_url":"https://api.github.com/users/therealklanni/following{/other_user}","gists_url":"https://api.github.com/users/therealklanni/gists{/gist_id}","starred_url":"https://api.github.com/users/therealklanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealklanni/subscriptions","organizations_url":"https://api.github.com/users/therealklanni/orgs","repos_url":"https://api.github.com/users/therealklanni/repos","events_url":"https://api.github.com/users/therealklanni/events{/privacy}","received_events_url":"https://api.github.com/users/therealklanni/received_events","type":"User","site_admin":false},"body":"Implements sync and async add operations on object lists. Each method returns a new object-list instance to keep them immutable.\r\n\r\nThe async method is a partial implementation, pending adapter implementation, but can be used as is (it just gets immediately resolved for now). Once adapters are implemented, the async method can be updated without impacting anything using the current async implementation.","created_at":"2015-04-04T01:03:22Z","updated_at":"2015-04-07T03:22:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76b8b83e690eeef6b423320176c2d21f15f262f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ericelliott/object-list/pulls/7/commits","review_comments_url":"https://api.github.com/repos/ericelliott/object-list/pulls/7/comments","review_comment_url":"https://api.github.com/repos/ericelliott/object-list/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ericelliott/object-list/issues/7/comments","statuses_url":"https://api.github.com/repos/ericelliott/object-list/statuses/ff48dd5428e7e2c56b52eb9ef94def3ebcbb0764","head":{"label":"therealklanni:master","ref":"master","sha":"ff48dd5428e7e2c56b52eb9ef94def3ebcbb0764","user":{"login":"therealklanni","id":626347,"avatar_url":"https://avatars.githubusercontent.com/u/626347?v=3","gravatar_id":"","url":"https://api.github.com/users/therealklanni","html_url":"https://github.com/therealklanni","followers_url":"https://api.github.com/users/therealklanni/followers","following_url":"https://api.github.com/users/therealklanni/following{/other_user}","gists_url":"https://api.github.com/users/therealklanni/gists{/gist_id}","starred_url":"https://api.github.com/users/therealklanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealklanni/subscriptions","organizations_url":"https://api.github.com/users/therealklanni/orgs","repos_url":"https://api.github.com/users/therealklanni/repos","events_url":"https://api.github.com/users/therealklanni/events{/privacy}","received_events_url":"https://api.github.com/users/therealklanni/received_events","type":"User","site_admin":false},"repo":{"id":33325488,"name":"object-list","full_name":"therealklanni/object-list","owner":{"login":"therealklanni","id":626347,"avatar_url":"https://avatars.githubusercontent.com/u/626347?v=3","gravatar_id":"","url":"https://api.github.com/users/therealklanni","html_url":"https://github.com/therealklanni","followers_url":"https://api.github.com/users/therealklanni/followers","following_url":"https://api.github.com/users/therealklanni/following{/other_user}","gists_url":"https://api.github.com/users/therealklanni/gists{/gist_id}","starred_url":"https://api.github.com/users/therealklanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealklanni/subscriptions","organizations_url":"https://api.github.com/users/therealklanni/orgs","repos_url":"https://api.github.com/users/therealklanni/repos","events_url":"https://api.github.com/users/therealklanni/events{/privacy}","received_events_url":"https://api.github.com/users/therealklanni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/therealklanni/object-list","description":"Treat arrays of objects like a db you can query.","fork":true,"url":"https://api.github.com/repos/therealklanni/object-list","forks_url":"https://api.github.com/repos/therealklanni/object-list/forks","keys_url":"https://api.github.com/repos/therealklanni/object-list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/therealklanni/object-list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/therealklanni/object-list/teams","hooks_url":"https://api.github.com/repos/therealklanni/object-list/hooks","issue_events_url":"https://api.github.com/repos/therealklanni/object-list/issues/events{/number}","events_url":"https://api.github.com/repos/therealklanni/object-list/events","assignees_url":"https://api.github.com/repos/therealklanni/object-list/assignees{/user}","branches_url":"https://api.github.com/repos/therealklanni/object-list/branches{/branch}","tags_url":"https://api.github.com/repos/therealklanni/object-list/tags","blobs_url":"https://api.github.com/repos/therealklanni/object-list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/therealklanni/object-list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/therealklanni/object-list/git/refs{/sha}","trees_url":"https://api.github.com/repos/therealklanni/object-list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/therealklanni/object-list/statuses/{sha}","languages_url":"https://api.github.com/repos/therealklanni/object-list/languages","stargazers_url":"https://api.github.com/repos/therealklanni/object-list/stargazers","contributors_url":"https://api.github.com/repos/therealklanni/object-list/contributors","subscribers_url":"https://api.github.com/repos/therealklanni/object-list/subscribers","subscription_url":"https://api.github.com/repos/therealklanni/object-list/subscription","commits_url":"https://api.github.com/repos/therealklanni/object-list/commits{/sha}","git_commits_url":"https://api.github.com/repos/therealklanni/object-list/git/commits{/sha}","comments_url":"https://api.github.com/repos/therealklanni/object-list/comments{/number}","issue_comment_url":"https://api.github.com/repos/therealklanni/object-list/issues/comments{/number}","contents_url":"https://api.github.com/repos/therealklanni/object-list/contents/{+path}","compare_url":"https://api.github.com/repos/therealklanni/object-list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/therealklanni/object-list/merges","archive_url":"https://api.github.com/repos/therealklanni/object-list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/therealklanni/object-list/downloads","issues_url":"https://api.github.com/repos/therealklanni/object-list/issues{/number}","pulls_url":"https://api.github.com/repos/therealklanni/object-list/pulls{/number}","milestones_url":"https://api.github.com/repos/therealklanni/object-list/milestones{/number}","notifications_url":"https://api.github.com/repos/therealklanni/object-list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/therealklanni/object-list/labels{/name}","releases_url":"https://api.github.com/repos/therealklanni/object-list/releases{/id}","created_at":"2015-04-02T18:39:38Z","updated_at":"2015-04-07T00:21:34Z","pushed_at":"2015-04-07T00:21:34Z","git_url":"git://github.com/therealklanni/object-list.git","ssh_url":"git@github.com:therealklanni/object-list.git","clone_url":"https://github.com/therealklanni/object-list.git","svn_url":"https://github.com/therealklanni/object-list","homepage":"","size":99,"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":"ericelliott:master","ref":"master","sha":"f7289509b5a242c147bd346e4eb30609a91db22c","user":{"login":"ericelliott","id":364727,"avatar_url":"https://avatars.githubusercontent.com/u/364727?v=3","gravatar_id":"","url":"https://api.github.com/users/ericelliott","html_url":"https://github.com/ericelliott","followers_url":"https://api.github.com/users/ericelliott/followers","following_url":"https://api.github.com/users/ericelliott/following{/other_user}","gists_url":"https://api.github.com/users/ericelliott/gists{/gist_id}","starred_url":"https://api.github.com/users/ericelliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericelliott/subscriptions","organizations_url":"https://api.github.com/users/ericelliott/orgs","repos_url":"https://api.github.com/users/ericelliott/repos","events_url":"https://api.github.com/users/ericelliott/events{/privacy}","received_events_url":"https://api.github.com/users/ericelliott/received_events","type":"User","site_admin":false},"repo":{"id":31504360,"name":"object-list","full_name":"ericelliott/object-list","owner":{"login":"ericelliott","id":364727,"avatar_url":"https://avatars.githubusercontent.com/u/364727?v=3","gravatar_id":"","url":"https://api.github.com/users/ericelliott","html_url":"https://github.com/ericelliott","followers_url":"https://api.github.com/users/ericelliott/followers","following_url":"https://api.github.com/users/ericelliott/following{/other_user}","gists_url":"https://api.github.com/users/ericelliott/gists{/gist_id}","starred_url":"https://api.github.com/users/ericelliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericelliott/subscriptions","organizations_url":"https://api.github.com/users/ericelliott/orgs","repos_url":"https://api.github.com/users/ericelliott/repos","events_url":"https://api.github.com/users/ericelliott/events{/privacy}","received_events_url":"https://api.github.com/users/ericelliott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericelliott/object-list","description":"Treat arrays of objects like a db you can query.","fork":false,"url":"https://api.github.com/repos/ericelliott/object-list","forks_url":"https://api.github.com/repos/ericelliott/object-list/forks","keys_url":"https://api.github.com/repos/ericelliott/object-list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericelliott/object-list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericelliott/object-list/teams","hooks_url":"https://api.github.com/repos/ericelliott/object-list/hooks","issue_events_url":"https://api.github.com/repos/ericelliott/object-list/issues/events{/number}","events_url":"https://api.github.com/repos/ericelliott/object-list/events","assignees_url":"https://api.github.com/repos/ericelliott/object-list/assignees{/user}","branches_url":"https://api.github.com/repos/ericelliott/object-list/branches{/branch}","tags_url":"https://api.github.com/repos/ericelliott/object-list/tags","blobs_url":"https://api.github.com/repos/ericelliott/object-list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericelliott/object-list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericelliott/object-list/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericelliott/object-list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericelliott/object-list/statuses/{sha}","languages_url":"https://api.github.com/repos/ericelliott/object-list/languages","stargazers_url":"https://api.github.com/repos/ericelliott/object-list/stargazers","contributors_url":"https://api.github.com/repos/ericelliott/object-list/contributors","subscribers_url":"https://api.github.com/repos/ericelliott/object-list/subscribers","subscription_url":"https://api.github.com/repos/ericelliott/object-list/subscription","commits_url":"https://api.github.com/repos/ericelliott/object-list/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericelliott/object-list/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericelliott/object-list/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericelliott/object-list/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericelliott/object-list/contents/{+path}","compare_url":"https://api.github.com/repos/ericelliott/object-list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericelliott/object-list/merges","archive_url":"https://api.github.com/repos/ericelliott/object-list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericelliott/object-list/downloads","issues_url":"https://api.github.com/repos/ericelliott/object-list/issues{/number}","pulls_url":"https://api.github.com/repos/ericelliott/object-list/pulls{/number}","milestones_url":"https://api.github.com/repos/ericelliott/object-list/milestones{/number}","notifications_url":"https://api.github.com/repos/ericelliott/object-list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericelliott/object-list/labels{/name}","releases_url":"https://api.github.com/repos/ericelliott/object-list/releases{/id}","created_at":"2015-03-01T17:38:38Z","updated_at":"2015-03-20T08:41:42Z","pushed_at":"2015-04-07T00:21:34Z","git_url":"git://github.com/ericelliott/object-list.git","ssh_url":"git@github.com:ericelliott/object-list.git","clone_url":"https://github.com/ericelliott/object-list.git","svn_url":"https://github.com/ericelliott/object-list","homepage":"","size":240,"stargazers_count":25,"watchers_count":25,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/7"},"html":{"href":"https://github.com/ericelliott/object-list/pull/7"},"issue":{"href":"https://api.github.com/repos/ericelliott/object-list/issues/7"},"comments":{"href":"https://api.github.com/repos/ericelliott/object-list/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ericelliott/object-list/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/ericelliott/object-list/statuses/ff48dd5428e7e2c56b52eb9ef94def3ebcbb0764"}}}}