{"action":"created","comment":{"url":"https://api.github.com/repos/Khan/react-components/pulls/comments/35494873","id":35494873,"diff_hunk":"@@ -24,6 +22,25 @@ var userSelect = rhs => {\n \n var sortableDisabled = userSelect(\"none\");\n \n+/**\n+ * Behaves like Array.prototype.filter, except it handle any iterable type (not just Arrays).\n+ */\n+function filter(obj, predicate) {\n+    var results = [];\n+    for (var i = 0, len = obj.length; i < len; i++) {\n+        var value = obj[i];\n+        if (predicate(value, i, obj))  results.push(value);\n+    }\n+    return results;\n+}\n+\n+/**\n+ * Return the values from arr1 that are not present in arr2.\n+ */\n+function difference(arr1, arr2) {\n+    return filter(arr1, (each) => {return arr2.indexOf(each) < 0});","path":"js/sortable.jsx","position":27,"original_position":27,"commit_id":"3a9e703c9f8d088a261f824485aa524e800cca8d","original_commit_id":"3a9e703c9f8d088a261f824485aa524e800cca8d","user":{"login":"kevinb7","id":1044413,"avatar_url":"https://avatars.githubusercontent.com/u/1044413?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinb7","html_url":"https://github.com/kevinb7","followers_url":"https://api.github.com/users/kevinb7/followers","following_url":"https://api.github.com/users/kevinb7/following{/other_user}","gists_url":"https://api.github.com/users/kevinb7/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinb7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinb7/subscriptions","organizations_url":"https://api.github.com/users/kevinb7/orgs","repos_url":"https://api.github.com/users/kevinb7/repos","events_url":"https://api.github.com/users/kevinb7/events{/privacy}","received_events_url":"https://api.github.com/users/kevinb7/received_events","type":"User","site_admin":false},"body":"Can you rename \"each\" to \"item\"?","created_at":"2015-07-26T16:54:15Z","updated_at":"2015-07-26T16:54:15Z","html_url":"https://github.com/Khan/react-components/pull/43#discussion_r35494873","pull_request_url":"https://api.github.com/repos/Khan/react-components/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/Khan/react-components/pulls/comments/35494873"},"html":{"href":"https://github.com/Khan/react-components/pull/43#discussion_r35494873"},"pull_request":{"href":"https://api.github.com/repos/Khan/react-components/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/Khan/react-components/pulls/43","id":40855175,"html_url":"https://github.com/Khan/react-components/pull/43","diff_url":"https://github.com/Khan/react-components/pull/43.diff","patch_url":"https://github.com/Khan/react-components/pull/43.patch","issue_url":"https://api.github.com/repos/Khan/react-components/issues/43","number":43,"state":"open","locked":false,"title":"Sortable no longer depends on Underscore","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"- Add simplified implementation of filter and difference\r\n- Use Array.prototype.map instead of _.map\r\n- Use Array.prototype.forEach instead of _.each\r\n- Update docs","created_at":"2015-07-26T15:49:32Z","updated_at":"2015-07-26T16:54:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da495544c0de4d215caeb2450b0e85e9a2736edd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Khan/react-components/pulls/43/commits","review_comments_url":"https://api.github.com/repos/Khan/react-components/pulls/43/comments","review_comment_url":"https://api.github.com/repos/Khan/react-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Khan/react-components/issues/43/comments","statuses_url":"https://api.github.com/repos/Khan/react-components/statuses/3a9e703c9f8d088a261f824485aa524e800cca8d","head":{"label":"sloria:sortable-no-underscore","ref":"sortable-no-underscore","sha":"3a9e703c9f8d088a261f824485aa524e800cca8d","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"repo":{"id":39730394,"name":"react-components","full_name":"sloria/react-components","owner":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sloria/react-components","description":"","fork":true,"url":"https://api.github.com/repos/sloria/react-components","forks_url":"https://api.github.com/repos/sloria/react-components/forks","keys_url":"https://api.github.com/repos/sloria/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sloria/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sloria/react-components/teams","hooks_url":"https://api.github.com/repos/sloria/react-components/hooks","issue_events_url":"https://api.github.com/repos/sloria/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/sloria/react-components/events","assignees_url":"https://api.github.com/repos/sloria/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/sloria/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/sloria/react-components/tags","blobs_url":"https://api.github.com/repos/sloria/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sloria/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sloria/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/sloria/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sloria/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/sloria/react-components/languages","stargazers_url":"https://api.github.com/repos/sloria/react-components/stargazers","contributors_url":"https://api.github.com/repos/sloria/react-components/contributors","subscribers_url":"https://api.github.com/repos/sloria/react-components/subscribers","subscription_url":"https://api.github.com/repos/sloria/react-components/subscription","commits_url":"https://api.github.com/repos/sloria/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/sloria/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/sloria/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/sloria/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/sloria/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/sloria/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sloria/react-components/merges","archive_url":"https://api.github.com/repos/sloria/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sloria/react-components/downloads","issues_url":"https://api.github.com/repos/sloria/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/sloria/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/sloria/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/sloria/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sloria/react-components/labels{/name}","releases_url":"https://api.github.com/repos/sloria/react-components/releases{/id}","created_at":"2015-07-26T15:32:07Z","updated_at":"2015-07-26T15:32:07Z","pushed_at":"2015-07-26T15:52:48Z","git_url":"git://github.com/sloria/react-components.git","ssh_url":"git@github.com:sloria/react-components.git","clone_url":"https://github.com/sloria/react-components.git","svn_url":"https://github.com/sloria/react-components","homepage":"khan.github.io/react-components/","size":39113,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Khan:master","ref":"master","sha":"d241ceb262eeaadfeae15e96cd9315861e2382e9","user":{"login":"Khan","id":15455,"avatar_url":"https://avatars.githubusercontent.com/u/15455?v=3","gravatar_id":"","url":"https://api.github.com/users/Khan","html_url":"https://github.com/Khan","followers_url":"https://api.github.com/users/Khan/followers","following_url":"https://api.github.com/users/Khan/following{/other_user}","gists_url":"https://api.github.com/users/Khan/gists{/gist_id}","starred_url":"https://api.github.com/users/Khan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Khan/subscriptions","organizations_url":"https://api.github.com/users/Khan/orgs","repos_url":"https://api.github.com/users/Khan/repos","events_url":"https://api.github.com/users/Khan/events{/privacy}","received_events_url":"https://api.github.com/users/Khan/received_events","type":"Organization","site_admin":false},"repo":{"id":18577404,"name":"react-components","full_name":"Khan/react-components","owner":{"login":"Khan","id":15455,"avatar_url":"https://avatars.githubusercontent.com/u/15455?v=3","gravatar_id":"","url":"https://api.github.com/users/Khan","html_url":"https://github.com/Khan","followers_url":"https://api.github.com/users/Khan/followers","following_url":"https://api.github.com/users/Khan/following{/other_user}","gists_url":"https://api.github.com/users/Khan/gists{/gist_id}","starred_url":"https://api.github.com/users/Khan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Khan/subscriptions","organizations_url":"https://api.github.com/users/Khan/orgs","repos_url":"https://api.github.com/users/Khan/repos","events_url":"https://api.github.com/users/Khan/events{/privacy}","received_events_url":"https://api.github.com/users/Khan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Khan/react-components","description":"","fork":false,"url":"https://api.github.com/repos/Khan/react-components","forks_url":"https://api.github.com/repos/Khan/react-components/forks","keys_url":"https://api.github.com/repos/Khan/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Khan/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Khan/react-components/teams","hooks_url":"https://api.github.com/repos/Khan/react-components/hooks","issue_events_url":"https://api.github.com/repos/Khan/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/Khan/react-components/events","assignees_url":"https://api.github.com/repos/Khan/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/Khan/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/Khan/react-components/tags","blobs_url":"https://api.github.com/repos/Khan/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Khan/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Khan/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Khan/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Khan/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/Khan/react-components/languages","stargazers_url":"https://api.github.com/repos/Khan/react-components/stargazers","contributors_url":"https://api.github.com/repos/Khan/react-components/contributors","subscribers_url":"https://api.github.com/repos/Khan/react-components/subscribers","subscription_url":"https://api.github.com/repos/Khan/react-components/subscription","commits_url":"https://api.github.com/repos/Khan/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Khan/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Khan/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Khan/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Khan/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/Khan/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Khan/react-components/merges","archive_url":"https://api.github.com/repos/Khan/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Khan/react-components/downloads","issues_url":"https://api.github.com/repos/Khan/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/Khan/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/Khan/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/Khan/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Khan/react-components/labels{/name}","releases_url":"https://api.github.com/repos/Khan/react-components/releases{/id}","created_at":"2014-04-08T22:38:15Z","updated_at":"2015-07-26T13:42:08Z","pushed_at":"2015-07-26T15:54:05Z","git_url":"git://github.com/Khan/react-components.git","ssh_url":"git@github.com:Khan/react-components.git","clone_url":"https://github.com/Khan/react-components.git","svn_url":"https://github.com/Khan/react-components","homepage":"khan.github.io/react-components/","size":39113,"stargazers_count":433,"watchers_count":433,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":17,"forks":38,"open_issues":17,"watchers":433,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Khan/react-components/pulls/43"},"html":{"href":"https://github.com/Khan/react-components/pull/43"},"issue":{"href":"https://api.github.com/repos/Khan/react-components/issues/43"},"comments":{"href":"https://api.github.com/repos/Khan/react-components/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/Khan/react-components/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/Khan/react-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Khan/react-components/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/Khan/react-components/statuses/3a9e703c9f8d088a261f824485aa524e800cca8d"}}}}