{"action":"created","comment":{"url":"https://api.github.com/repos/sindresorhus/anatine/pulls/comments/63284304","id":63284304,"diff_hunk":"@@ -310,6 +310,11 @@ document.addEventListener('DOMContentLoaded', () => {\n \t// enable OS specific styles\n \tdocument.documentElement.classList.add(`os-${process.platform}`);\n \n-\t// TODO: figure out a better way to detect when React is done\n-\tsetTimeout(init, 300);\n+\t// detect when React is ready before firing init\n+\tconst awaitReact = setInterval(() => {","path":"browser.js","position":null,"original_position":7,"commit_id":"1ac8494020994d2dbf6392f36606570842c827ad","original_commit_id":"2da33afa970d3d724a23e3e049b3b47c97f98c1a","user":{"login":"paulmolluzzo","id":737065,"avatar_url":"https://avatars.githubusercontent.com/u/737065?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmolluzzo","html_url":"https://github.com/paulmolluzzo","followers_url":"https://api.github.com/users/paulmolluzzo/followers","following_url":"https://api.github.com/users/paulmolluzzo/following{/other_user}","gists_url":"https://api.github.com/users/paulmolluzzo/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmolluzzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmolluzzo/subscriptions","organizations_url":"https://api.github.com/users/paulmolluzzo/orgs","repos_url":"https://api.github.com/users/paulmolluzzo/repos","events_url":"https://api.github.com/users/paulmolluzzo/events{/privacy}","received_events_url":"https://api.github.com/users/paulmolluzzo/received_events","type":"User","site_admin":false},"body":"This is using `querySelector` so it's only getting the first matching element, and we (currently) have no reason to ask for more. I would only say that we're looking for _at least one_ of some item ever anyway. I can't think of any scenario where you'd need a whole list of nodes. For example, you won't click more than 1 thing at a time. I could change it to a `querySelectorAll`, but I don't see why we need that. Feel free to point out something I'm missing. 😄        ","created_at":"2016-05-15T00:32:40Z","updated_at":"2016-05-15T00:32:40Z","html_url":"https://github.com/sindresorhus/anatine/pull/42#discussion_r63284304","pull_request_url":"https://api.github.com/repos/sindresorhus/anatine/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/comments/63284304"},"html":{"href":"https://github.com/sindresorhus/anatine/pull/42#discussion_r63284304"},"pull_request":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/sindresorhus/anatine/pulls/42","id":70078853,"html_url":"https://github.com/sindresorhus/anatine/pull/42","diff_url":"https://github.com/sindresorhus/anatine/pull/42.diff","patch_url":"https://github.com/sindresorhus/anatine/pull/42.patch","issue_url":"https://api.github.com/repos/sindresorhus/anatine/issues/42","number":42,"state":"open","locked":false,"title":"Use clearInterval to wait for React before init","user":{"login":"paulmolluzzo","id":737065,"avatar_url":"https://avatars.githubusercontent.com/u/737065?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmolluzzo","html_url":"https://github.com/paulmolluzzo","followers_url":"https://api.github.com/users/paulmolluzzo/followers","following_url":"https://api.github.com/users/paulmolluzzo/following{/other_user}","gists_url":"https://api.github.com/users/paulmolluzzo/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmolluzzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmolluzzo/subscriptions","organizations_url":"https://api.github.com/users/paulmolluzzo/orgs","repos_url":"https://api.github.com/users/paulmolluzzo/repos","events_url":"https://api.github.com/users/paulmolluzzo/events{/privacy}","received_events_url":"https://api.github.com/users/paulmolluzzo/received_events","type":"User","site_admin":false},"body":"This is a super simple solution to waiting for React before firing the `init` function. Since the `init` only really depends on the `header` element, we're waiting on that to load into the DOM.\r\n\r\nThis fixes #15.\r\n\r\n// @sindresorhus   ","created_at":"2016-05-14T02:05:33Z","updated_at":"2016-05-15T00:32:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"194d1c16c54e68a2242531e1a0378abf27df4cfd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sindresorhus/anatine/pulls/42/commits","review_comments_url":"https://api.github.com/repos/sindresorhus/anatine/pulls/42/comments","review_comment_url":"https://api.github.com/repos/sindresorhus/anatine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sindresorhus/anatine/issues/42/comments","statuses_url":"https://api.github.com/repos/sindresorhus/anatine/statuses/1ac8494020994d2dbf6392f36606570842c827ad","head":{"label":"sindresorhus:await-react","ref":"await-react","sha":"1ac8494020994d2dbf6392f36606570842c827ad","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":58088954,"name":"anatine","full_name":"sindresorhus/anatine","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/anatine","description":"Pristine Twitter app","fork":false,"url":"https://api.github.com/repos/sindresorhus/anatine","forks_url":"https://api.github.com/repos/sindresorhus/anatine/forks","keys_url":"https://api.github.com/repos/sindresorhus/anatine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/anatine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/anatine/teams","hooks_url":"https://api.github.com/repos/sindresorhus/anatine/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/anatine/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/anatine/events","assignees_url":"https://api.github.com/repos/sindresorhus/anatine/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/anatine/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/anatine/tags","blobs_url":"https://api.github.com/repos/sindresorhus/anatine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/anatine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/anatine/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/anatine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/anatine/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/anatine/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/anatine/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/anatine/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/anatine/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/anatine/subscription","commits_url":"https://api.github.com/repos/sindresorhus/anatine/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/anatine/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/anatine/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/anatine/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/anatine/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/anatine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/anatine/merges","archive_url":"https://api.github.com/repos/sindresorhus/anatine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/anatine/downloads","issues_url":"https://api.github.com/repos/sindresorhus/anatine/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/anatine/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/anatine/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/anatine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/anatine/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/anatine/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/anatine/deployments","created_at":"2016-05-04T22:53:26Z","updated_at":"2016-05-14T23:28:31Z","pushed_at":"2016-05-15T00:28:35Z","git_url":"git://github.com/sindresorhus/anatine.git","ssh_url":"git@github.com:sindresorhus/anatine.git","clone_url":"https://github.com/sindresorhus/anatine.git","svn_url":"https://github.com/sindresorhus/anatine","homepage":null,"size":1331,"stargazers_count":457,"watchers_count":457,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":15,"forks":19,"open_issues":15,"watchers":457,"default_branch":"master"}},"base":{"label":"sindresorhus:master","ref":"master","sha":"2865ae937b71def7204bd14a64f1190f21423059","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"repo":{"id":58088954,"name":"anatine","full_name":"sindresorhus/anatine","owner":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sindresorhus/anatine","description":"Pristine Twitter app","fork":false,"url":"https://api.github.com/repos/sindresorhus/anatine","forks_url":"https://api.github.com/repos/sindresorhus/anatine/forks","keys_url":"https://api.github.com/repos/sindresorhus/anatine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sindresorhus/anatine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sindresorhus/anatine/teams","hooks_url":"https://api.github.com/repos/sindresorhus/anatine/hooks","issue_events_url":"https://api.github.com/repos/sindresorhus/anatine/issues/events{/number}","events_url":"https://api.github.com/repos/sindresorhus/anatine/events","assignees_url":"https://api.github.com/repos/sindresorhus/anatine/assignees{/user}","branches_url":"https://api.github.com/repos/sindresorhus/anatine/branches{/branch}","tags_url":"https://api.github.com/repos/sindresorhus/anatine/tags","blobs_url":"https://api.github.com/repos/sindresorhus/anatine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sindresorhus/anatine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sindresorhus/anatine/git/refs{/sha}","trees_url":"https://api.github.com/repos/sindresorhus/anatine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sindresorhus/anatine/statuses/{sha}","languages_url":"https://api.github.com/repos/sindresorhus/anatine/languages","stargazers_url":"https://api.github.com/repos/sindresorhus/anatine/stargazers","contributors_url":"https://api.github.com/repos/sindresorhus/anatine/contributors","subscribers_url":"https://api.github.com/repos/sindresorhus/anatine/subscribers","subscription_url":"https://api.github.com/repos/sindresorhus/anatine/subscription","commits_url":"https://api.github.com/repos/sindresorhus/anatine/commits{/sha}","git_commits_url":"https://api.github.com/repos/sindresorhus/anatine/git/commits{/sha}","comments_url":"https://api.github.com/repos/sindresorhus/anatine/comments{/number}","issue_comment_url":"https://api.github.com/repos/sindresorhus/anatine/issues/comments{/number}","contents_url":"https://api.github.com/repos/sindresorhus/anatine/contents/{+path}","compare_url":"https://api.github.com/repos/sindresorhus/anatine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sindresorhus/anatine/merges","archive_url":"https://api.github.com/repos/sindresorhus/anatine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sindresorhus/anatine/downloads","issues_url":"https://api.github.com/repos/sindresorhus/anatine/issues{/number}","pulls_url":"https://api.github.com/repos/sindresorhus/anatine/pulls{/number}","milestones_url":"https://api.github.com/repos/sindresorhus/anatine/milestones{/number}","notifications_url":"https://api.github.com/repos/sindresorhus/anatine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sindresorhus/anatine/labels{/name}","releases_url":"https://api.github.com/repos/sindresorhus/anatine/releases{/id}","deployments_url":"https://api.github.com/repos/sindresorhus/anatine/deployments","created_at":"2016-05-04T22:53:26Z","updated_at":"2016-05-14T23:28:31Z","pushed_at":"2016-05-15T00:28:35Z","git_url":"git://github.com/sindresorhus/anatine.git","ssh_url":"git@github.com:sindresorhus/anatine.git","clone_url":"https://github.com/sindresorhus/anatine.git","svn_url":"https://github.com/sindresorhus/anatine","homepage":null,"size":1331,"stargazers_count":457,"watchers_count":457,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":15,"forks":19,"open_issues":15,"watchers":457,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/42"},"html":{"href":"https://github.com/sindresorhus/anatine/pull/42"},"issue":{"href":"https://api.github.com/repos/sindresorhus/anatine/issues/42"},"comments":{"href":"https://api.github.com/repos/sindresorhus/anatine/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sindresorhus/anatine/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/sindresorhus/anatine/statuses/1ac8494020994d2dbf6392f36606570842c827ad"}}}}