{"action":"created","comment":{"url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/comments/223417383","pull_request_review_id":162539296,"id":223417383,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzQxNzM4Mw==","diff_hunk":"@@ -7,21 +7,51 @@ import { graphSearchIPAddress } from '../constants'\n import './results.scss'\n \n const ResultsComponent = React.createClass({\n+  componentDidMount() {\n+    window.addEventListener('scroll', this.handleScroll)\n+  },\n+\n+  componentWillUnmount() {\n+    window.removeEventListener('scroll', this.handleScroll)\n+  },\n+\n   handleLoadMore() {\n     this.props.getPage(this.props.query, this.props.results.length)\n   },\n \n+  isElementInViewport(el) {\n+    const rect = el.getBoundingClientRect()\n+\n+    return (\n+      rect.top >= 0 &&\n+      rect.left >= 0 &&\n+      Math.floor(rect.bottom) <=\n+        (window.innerHeight ||\n+          document.documentElement.clientHeight) /*or $(window).height() */ &&\n+      Math.floor(rect.right) <=\n+        (window.innerWidth ||\n+          document.documentElement.clientWidth) /*or $(window).width() */\n+    )\n+  },\n+\n+  handleScroll(event) {\n+    // is the footer in view?\n+    // if yes, load more data\n+    const footerEl = document.getElementById('credits')\n+    const footerIsVisible = this.isElementInViewport(footerEl)","path":"react/components/results.js","position":35,"original_position":35,"commit_id":"239065291024671fdbf1ef4f9ea75ec415fde599","original_commit_id":"68e7423cf46c747be35b9fd2e68a3f7df28e1d2a","user":{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false},"body":"`this.isElementInViewport` _is_ cool, but I should be cirucmspect and note that it is a helper function that I add, not a browser API (not yet at least)","created_at":"2018-10-08T16:01:23Z","updated_at":"2018-10-08T16:01:24Z","html_url":"https://github.com/enjalot/blockbuilder-search/pull/60#discussion_r223417383","pull_request_url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/comments/223417383"},"html":{"href":"https://github.com/enjalot/blockbuilder-search/pull/60#discussion_r223417383"},"pull_request":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60"}},"in_reply_to_id":223328067},"pull_request":{"url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60","id":220464960,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNDY0OTYw","html_url":"https://github.com/enjalot/blockbuilder-search/pull/60","diff_url":"https://github.com/enjalot/blockbuilder-search/pull/60.diff","patch_url":"https://github.com/enjalot/blockbuilder-search/pull/60.patch","issue_url":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/60","number":60,"state":"open","locked":false,"title":"micah/59/infinite scroll","user":{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false},"body":"This PR implements infinite scroll for the blockbuilder search result page ✨ \r\n\r\nfix #59\r\n\r\n## demo video\r\n[![screen shot 2018-10-04 at 10 58 13 am](https://user-images.githubusercontent.com/2119400/46493151-6cf03880-c7c4-11e8-91a9-1dd09edb8612.png)](https://www.youtube.com/watch?v=QTz6w0eu5x4)\r\nhttps://www.youtube.com/watch?v=QTz6w0eu5x4\r\n","created_at":"2018-10-04T17:55:27Z","updated_at":"2018-10-08T16:01:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc4276600707233432653c2823e5753cc5e50363","assignee":{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false},"assignees":[{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"enjalot","id":96189,"node_id":"MDQ6VXNlcjk2MTg5","avatar_url":"https://avatars2.githubusercontent.com/u/96189?v=4","gravatar_id":"","url":"https://api.github.com/users/enjalot","html_url":"https://github.com/enjalot","followers_url":"https://api.github.com/users/enjalot/followers","following_url":"https://api.github.com/users/enjalot/following{/other_user}","gists_url":"https://api.github.com/users/enjalot/gists{/gist_id}","starred_url":"https://api.github.com/users/enjalot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enjalot/subscriptions","organizations_url":"https://api.github.com/users/enjalot/orgs","repos_url":"https://api.github.com/users/enjalot/repos","events_url":"https://api.github.com/users/enjalot/events{/privacy}","received_events_url":"https://api.github.com/users/enjalot/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60/commits","review_comments_url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60/comments","review_comment_url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/60/comments","statuses_url":"https://api.github.com/repos/enjalot/blockbuilder-search/statuses/239065291024671fdbf1ef4f9ea75ec415fde599","head":{"label":"micahstubbs:micah/59/infinite-scroll","ref":"micah/59/infinite-scroll","sha":"239065291024671fdbf1ef4f9ea75ec415fde599","user":{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false},"repo":{"id":58284066,"node_id":"MDEwOlJlcG9zaXRvcnk1ODI4NDA2Ng==","name":"blockbuilder-search","full_name":"micahstubbs/blockbuilder-search","private":false,"owner":{"login":"micahstubbs","id":2119400,"node_id":"MDQ6VXNlcjIxMTk0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2119400?v=4","gravatar_id":"","url":"https://api.github.com/users/micahstubbs","html_url":"https://github.com/micahstubbs","followers_url":"https://api.github.com/users/micahstubbs/followers","following_url":"https://api.github.com/users/micahstubbs/following{/other_user}","gists_url":"https://api.github.com/users/micahstubbs/gists{/gist_id}","starred_url":"https://api.github.com/users/micahstubbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micahstubbs/subscriptions","organizations_url":"https://api.github.com/users/micahstubbs/orgs","repos_url":"https://api.github.com/users/micahstubbs/repos","events_url":"https://api.github.com/users/micahstubbs/events{/privacy}","received_events_url":"https://api.github.com/users/micahstubbs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/micahstubbs/blockbuilder-search","description":"API endpoint and UI for blockbuilder search page","fork":true,"url":"https://api.github.com/repos/micahstubbs/blockbuilder-search","forks_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/forks","keys_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/keys{/key_id}","collaborators_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/teams","hooks_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/hooks","issue_events_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/issues/events{/number}","events_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/events","assignees_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/assignees{/user}","branches_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/branches{/branch}","tags_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/tags","blobs_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/git/refs{/sha}","trees_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/git/trees{/sha}","statuses_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/statuses/{sha}","languages_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/languages","stargazers_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/stargazers","contributors_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/contributors","subscribers_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/subscribers","subscription_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/subscription","commits_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/commits{/sha}","git_commits_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/git/commits{/sha}","comments_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/comments{/number}","issue_comment_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/issues/comments{/number}","contents_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/contents/{+path}","compare_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/compare/{base}...{head}","merges_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/merges","archive_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/downloads","issues_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/issues{/number}","pulls_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/pulls{/number}","milestones_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/milestones{/number}","notifications_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/labels{/name}","releases_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/releases{/id}","deployments_url":"https://api.github.com/repos/micahstubbs/blockbuilder-search/deployments","created_at":"2016-05-07T20:54:30Z","updated_at":"2018-10-08T15:39:53Z","pushed_at":"2018-10-08T15:58:43Z","git_url":"git://github.com/micahstubbs/blockbuilder-search.git","ssh_url":"git@github.com:micahstubbs/blockbuilder-search.git","clone_url":"https://github.com/micahstubbs/blockbuilder-search.git","svn_url":"https://github.com/micahstubbs/blockbuilder-search","homepage":null,"size":18249,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"enjalot:master","ref":"master","sha":"80543b7ce4ee3d3ea088a69161d78385db415aff","user":{"login":"enjalot","id":96189,"node_id":"MDQ6VXNlcjk2MTg5","avatar_url":"https://avatars2.githubusercontent.com/u/96189?v=4","gravatar_id":"","url":"https://api.github.com/users/enjalot","html_url":"https://github.com/enjalot","followers_url":"https://api.github.com/users/enjalot/followers","following_url":"https://api.github.com/users/enjalot/following{/other_user}","gists_url":"https://api.github.com/users/enjalot/gists{/gist_id}","starred_url":"https://api.github.com/users/enjalot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enjalot/subscriptions","organizations_url":"https://api.github.com/users/enjalot/orgs","repos_url":"https://api.github.com/users/enjalot/repos","events_url":"https://api.github.com/users/enjalot/events{/privacy}","received_events_url":"https://api.github.com/users/enjalot/received_events","type":"User","site_admin":false},"repo":{"id":51679632,"node_id":"MDEwOlJlcG9zaXRvcnk1MTY3OTYzMg==","name":"blockbuilder-search","full_name":"enjalot/blockbuilder-search","private":false,"owner":{"login":"enjalot","id":96189,"node_id":"MDQ6VXNlcjk2MTg5","avatar_url":"https://avatars2.githubusercontent.com/u/96189?v=4","gravatar_id":"","url":"https://api.github.com/users/enjalot","html_url":"https://github.com/enjalot","followers_url":"https://api.github.com/users/enjalot/followers","following_url":"https://api.github.com/users/enjalot/following{/other_user}","gists_url":"https://api.github.com/users/enjalot/gists{/gist_id}","starred_url":"https://api.github.com/users/enjalot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enjalot/subscriptions","organizations_url":"https://api.github.com/users/enjalot/orgs","repos_url":"https://api.github.com/users/enjalot/repos","events_url":"https://api.github.com/users/enjalot/events{/privacy}","received_events_url":"https://api.github.com/users/enjalot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/enjalot/blockbuilder-search","description":"API endpoint and UI for blockbuilder search page","fork":false,"url":"https://api.github.com/repos/enjalot/blockbuilder-search","forks_url":"https://api.github.com/repos/enjalot/blockbuilder-search/forks","keys_url":"https://api.github.com/repos/enjalot/blockbuilder-search/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enjalot/blockbuilder-search/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enjalot/blockbuilder-search/teams","hooks_url":"https://api.github.com/repos/enjalot/blockbuilder-search/hooks","issue_events_url":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/events{/number}","events_url":"https://api.github.com/repos/enjalot/blockbuilder-search/events","assignees_url":"https://api.github.com/repos/enjalot/blockbuilder-search/assignees{/user}","branches_url":"https://api.github.com/repos/enjalot/blockbuilder-search/branches{/branch}","tags_url":"https://api.github.com/repos/enjalot/blockbuilder-search/tags","blobs_url":"https://api.github.com/repos/enjalot/blockbuilder-search/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enjalot/blockbuilder-search/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enjalot/blockbuilder-search/git/refs{/sha}","trees_url":"https://api.github.com/repos/enjalot/blockbuilder-search/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enjalot/blockbuilder-search/statuses/{sha}","languages_url":"https://api.github.com/repos/enjalot/blockbuilder-search/languages","stargazers_url":"https://api.github.com/repos/enjalot/blockbuilder-search/stargazers","contributors_url":"https://api.github.com/repos/enjalot/blockbuilder-search/contributors","subscribers_url":"https://api.github.com/repos/enjalot/blockbuilder-search/subscribers","subscription_url":"https://api.github.com/repos/enjalot/blockbuilder-search/subscription","commits_url":"https://api.github.com/repos/enjalot/blockbuilder-search/commits{/sha}","git_commits_url":"https://api.github.com/repos/enjalot/blockbuilder-search/git/commits{/sha}","comments_url":"https://api.github.com/repos/enjalot/blockbuilder-search/comments{/number}","issue_comment_url":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/comments{/number}","contents_url":"https://api.github.com/repos/enjalot/blockbuilder-search/contents/{+path}","compare_url":"https://api.github.com/repos/enjalot/blockbuilder-search/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enjalot/blockbuilder-search/merges","archive_url":"https://api.github.com/repos/enjalot/blockbuilder-search/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enjalot/blockbuilder-search/downloads","issues_url":"https://api.github.com/repos/enjalot/blockbuilder-search/issues{/number}","pulls_url":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls{/number}","milestones_url":"https://api.github.com/repos/enjalot/blockbuilder-search/milestones{/number}","notifications_url":"https://api.github.com/repos/enjalot/blockbuilder-search/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enjalot/blockbuilder-search/labels{/name}","releases_url":"https://api.github.com/repos/enjalot/blockbuilder-search/releases{/id}","deployments_url":"https://api.github.com/repos/enjalot/blockbuilder-search/deployments","created_at":"2016-02-14T04:29:58Z","updated_at":"2018-10-08T15:39:51Z","pushed_at":"2018-10-08T15:58:44Z","git_url":"git://github.com/enjalot/blockbuilder-search.git","ssh_url":"git@github.com:enjalot/blockbuilder-search.git","clone_url":"https://github.com/enjalot/blockbuilder-search.git","svn_url":"https://github.com/enjalot/blockbuilder-search","homepage":null,"size":13403,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":26,"license":null,"forks":4,"open_issues":26,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60"},"html":{"href":"https://github.com/enjalot/blockbuilder-search/pull/60"},"issue":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/60"},"comments":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/enjalot/blockbuilder-search/statuses/239065291024671fdbf1ef4f9ea75ec415fde599"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"micahstubbs"}}