{"action":"created","comment":{"url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/comments/225106478","pull_request_review_id":164632275,"id":225106478,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTEwNjQ3OA==","diff_hunk":"@@ -105,19 +105,20 @@ class Room {\n     webhook.send(`Room ${this._id} has finished. Winner: \\`\\`\\`${JSON.stringify(winner)}\\`\\`\\``, () => {});\n   }\n \n-  setupNoms(searchLocation, searchRadius) {","path":"src/Room.js","position":22,"original_position":22,"commit_id":"7a893d6f357c1bbe88657d8934738fc403e58535","original_commit_id":"7a893d6f357c1bbe88657d8934738fc403e58535","user":{"login":"maccyber","id":701351,"node_id":"MDQ6VXNlcjcwMTM1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/701351?v=4","gravatar_id":"","url":"https://api.github.com/users/maccyber","html_url":"https://github.com/maccyber","followers_url":"https://api.github.com/users/maccyber/followers","following_url":"https://api.github.com/users/maccyber/following{/other_user}","gists_url":"https://api.github.com/users/maccyber/gists{/gist_id}","starred_url":"https://api.github.com/users/maccyber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maccyber/subscriptions","organizations_url":"https://api.github.com/users/maccyber/orgs","repos_url":"https://api.github.com/users/maccyber/repos","events_url":"https://api.github.com/users/maccyber/events{/privacy}","received_events_url":"https://api.github.com/users/maccyber/received_events","type":"User","site_admin":false},"body":"I also think it's easier/prettier with async/await with something like:\r\n\r\n```js\r\nasync setupNoms(searchLocation, searchRadius, gpsPosition) {\r\n    const meters = 1609 * searchRadius;\r\n    const location = gpsPosition ? `longitude=${gpsPosition.longitude}&latitude=${gpsPosition.latitude}` : `location=${searchLocation}`;\r\n    try {\r\n      const [firstRequest, secondRequest] = await axios.all([\r\n        axios.get(`https://api.yelp.com/v3/businesses/search?term=restaurants&radius=${meters}&limit=50&${location}`, yelpConfig),\r\n        axios.get(`https://api.yelp.com/v3/businesses/search?term=restaurants&radius=${meters}&limit=50&offset=50&${location}`, yelpConfig)\r\n      ]);\r\n      const businesses = Object.assign([], firstRequest.data.businesses, secondRequest.data.businesses);\r\n      const newNoms = businesses.map(biz => ({veto: false, votes: [], ...biz}));\r\n      this._nomnoms = [...this._nomnoms, ...newNoms];\r\n      console.log('noms set',this._nomnoms, this._nomnoms.length);\r\n    } catch (e) {\r\n      console.error(e);\r\n    };\r\n  }\r\n```","created_at":"2018-10-15T10:02:46Z","updated_at":"2018-10-15T10:02:46Z","html_url":"https://github.com/infinite-robots/nomnom/pull/8#discussion_r225106478","pull_request_url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/comments/225106478"},"html":{"href":"https://github.com/infinite-robots/nomnom/pull/8#discussion_r225106478"},"pull_request":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8","id":222646616,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNjQ2NjE2","html_url":"https://github.com/infinite-robots/nomnom/pull/8","diff_url":"https://github.com/infinite-robots/nomnom/pull/8.diff","patch_url":"https://github.com/infinite-robots/nomnom/pull/8.patch","issue_url":"https://api.github.com/repos/infinite-robots/nomnom/issues/8","number":8,"state":"open","locked":false,"title":"Adds gps location to API","user":{"login":"maccyber","id":701351,"node_id":"MDQ6VXNlcjcwMTM1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/701351?v=4","gravatar_id":"","url":"https://api.github.com/users/maccyber","html_url":"https://github.com/maccyber","followers_url":"https://api.github.com/users/maccyber/followers","following_url":"https://api.github.com/users/maccyber/following{/other_user}","gists_url":"https://api.github.com/users/maccyber/gists{/gist_id}","starred_url":"https://api.github.com/users/maccyber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maccyber/subscriptions","organizations_url":"https://api.github.com/users/maccyber/orgs","repos_url":"https://api.github.com/users/maccyber/repos","events_url":"https://api.github.com/users/maccyber/events{/privacy}","received_events_url":"https://api.github.com/users/maccyber/received_events","type":"User","site_admin":false},"body":"Adds gps location to API","created_at":"2018-10-13T12:13:49Z","updated_at":"2018-10-15T10:02:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c22fe38832883102fd917d87bb34f95b4b4852c1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8/commits","review_comments_url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8/comments","review_comment_url":"https://api.github.com/repos/infinite-robots/nomnom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infinite-robots/nomnom/issues/8/comments","statuses_url":"https://api.github.com/repos/infinite-robots/nomnom/statuses/7a893d6f357c1bbe88657d8934738fc403e58535","head":{"label":"maccyber:master","ref":"master","sha":"7a893d6f357c1bbe88657d8934738fc403e58535","user":{"login":"maccyber","id":701351,"node_id":"MDQ6VXNlcjcwMTM1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/701351?v=4","gravatar_id":"","url":"https://api.github.com/users/maccyber","html_url":"https://github.com/maccyber","followers_url":"https://api.github.com/users/maccyber/followers","following_url":"https://api.github.com/users/maccyber/following{/other_user}","gists_url":"https://api.github.com/users/maccyber/gists{/gist_id}","starred_url":"https://api.github.com/users/maccyber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maccyber/subscriptions","organizations_url":"https://api.github.com/users/maccyber/orgs","repos_url":"https://api.github.com/users/maccyber/repos","events_url":"https://api.github.com/users/maccyber/events{/privacy}","received_events_url":"https://api.github.com/users/maccyber/received_events","type":"User","site_admin":false},"repo":{"id":152868431,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI4Njg0MzE=","name":"nomnom","full_name":"maccyber/nomnom","private":false,"owner":{"login":"maccyber","id":701351,"node_id":"MDQ6VXNlcjcwMTM1MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/701351?v=4","gravatar_id":"","url":"https://api.github.com/users/maccyber","html_url":"https://github.com/maccyber","followers_url":"https://api.github.com/users/maccyber/followers","following_url":"https://api.github.com/users/maccyber/following{/other_user}","gists_url":"https://api.github.com/users/maccyber/gists{/gist_id}","starred_url":"https://api.github.com/users/maccyber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maccyber/subscriptions","organizations_url":"https://api.github.com/users/maccyber/orgs","repos_url":"https://api.github.com/users/maccyber/repos","events_url":"https://api.github.com/users/maccyber/events{/privacy}","received_events_url":"https://api.github.com/users/maccyber/received_events","type":"User","site_admin":false},"html_url":"https://github.com/maccyber/nomnom","description":"group restaurant picker","fork":true,"url":"https://api.github.com/repos/maccyber/nomnom","forks_url":"https://api.github.com/repos/maccyber/nomnom/forks","keys_url":"https://api.github.com/repos/maccyber/nomnom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maccyber/nomnom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maccyber/nomnom/teams","hooks_url":"https://api.github.com/repos/maccyber/nomnom/hooks","issue_events_url":"https://api.github.com/repos/maccyber/nomnom/issues/events{/number}","events_url":"https://api.github.com/repos/maccyber/nomnom/events","assignees_url":"https://api.github.com/repos/maccyber/nomnom/assignees{/user}","branches_url":"https://api.github.com/repos/maccyber/nomnom/branches{/branch}","tags_url":"https://api.github.com/repos/maccyber/nomnom/tags","blobs_url":"https://api.github.com/repos/maccyber/nomnom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maccyber/nomnom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maccyber/nomnom/git/refs{/sha}","trees_url":"https://api.github.com/repos/maccyber/nomnom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maccyber/nomnom/statuses/{sha}","languages_url":"https://api.github.com/repos/maccyber/nomnom/languages","stargazers_url":"https://api.github.com/repos/maccyber/nomnom/stargazers","contributors_url":"https://api.github.com/repos/maccyber/nomnom/contributors","subscribers_url":"https://api.github.com/repos/maccyber/nomnom/subscribers","subscription_url":"https://api.github.com/repos/maccyber/nomnom/subscription","commits_url":"https://api.github.com/repos/maccyber/nomnom/commits{/sha}","git_commits_url":"https://api.github.com/repos/maccyber/nomnom/git/commits{/sha}","comments_url":"https://api.github.com/repos/maccyber/nomnom/comments{/number}","issue_comment_url":"https://api.github.com/repos/maccyber/nomnom/issues/comments{/number}","contents_url":"https://api.github.com/repos/maccyber/nomnom/contents/{+path}","compare_url":"https://api.github.com/repos/maccyber/nomnom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maccyber/nomnom/merges","archive_url":"https://api.github.com/repos/maccyber/nomnom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maccyber/nomnom/downloads","issues_url":"https://api.github.com/repos/maccyber/nomnom/issues{/number}","pulls_url":"https://api.github.com/repos/maccyber/nomnom/pulls{/number}","milestones_url":"https://api.github.com/repos/maccyber/nomnom/milestones{/number}","notifications_url":"https://api.github.com/repos/maccyber/nomnom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maccyber/nomnom/labels{/name}","releases_url":"https://api.github.com/repos/maccyber/nomnom/releases{/id}","deployments_url":"https://api.github.com/repos/maccyber/nomnom/deployments","created_at":"2018-10-13T12:11:10Z","updated_at":"2018-10-13T12:13:25Z","pushed_at":"2018-10-13T12:13:24Z","git_url":"git://github.com/maccyber/nomnom.git","ssh_url":"git@github.com:maccyber/nomnom.git","clone_url":"https://github.com/maccyber/nomnom.git","svn_url":"https://github.com/maccyber/nomnom","homepage":"http://nomnom.site","size":148,"stargazers_count":0,"watchers_count":0,"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":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"infinite-robots:master","ref":"master","sha":"c6295f7dcddc8dae84c0848cbb26ee7cb35833ad","user":{"login":"infinite-robots","id":38761576,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzYxNTc2","avatar_url":"https://avatars3.githubusercontent.com/u/38761576?v=4","gravatar_id":"","url":"https://api.github.com/users/infinite-robots","html_url":"https://github.com/infinite-robots","followers_url":"https://api.github.com/users/infinite-robots/followers","following_url":"https://api.github.com/users/infinite-robots/following{/other_user}","gists_url":"https://api.github.com/users/infinite-robots/gists{/gist_id}","starred_url":"https://api.github.com/users/infinite-robots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinite-robots/subscriptions","organizations_url":"https://api.github.com/users/infinite-robots/orgs","repos_url":"https://api.github.com/users/infinite-robots/repos","events_url":"https://api.github.com/users/infinite-robots/events{/privacy}","received_events_url":"https://api.github.com/users/infinite-robots/received_events","type":"Organization","site_admin":false},"repo":{"id":144171574,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQxNzE1NzQ=","name":"nomnom","full_name":"infinite-robots/nomnom","private":false,"owner":{"login":"infinite-robots","id":38761576,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4NzYxNTc2","avatar_url":"https://avatars3.githubusercontent.com/u/38761576?v=4","gravatar_id":"","url":"https://api.github.com/users/infinite-robots","html_url":"https://github.com/infinite-robots","followers_url":"https://api.github.com/users/infinite-robots/followers","following_url":"https://api.github.com/users/infinite-robots/following{/other_user}","gists_url":"https://api.github.com/users/infinite-robots/gists{/gist_id}","starred_url":"https://api.github.com/users/infinite-robots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinite-robots/subscriptions","organizations_url":"https://api.github.com/users/infinite-robots/orgs","repos_url":"https://api.github.com/users/infinite-robots/repos","events_url":"https://api.github.com/users/infinite-robots/events{/privacy}","received_events_url":"https://api.github.com/users/infinite-robots/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/infinite-robots/nomnom","description":"group restaurant picker","fork":false,"url":"https://api.github.com/repos/infinite-robots/nomnom","forks_url":"https://api.github.com/repos/infinite-robots/nomnom/forks","keys_url":"https://api.github.com/repos/infinite-robots/nomnom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infinite-robots/nomnom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infinite-robots/nomnom/teams","hooks_url":"https://api.github.com/repos/infinite-robots/nomnom/hooks","issue_events_url":"https://api.github.com/repos/infinite-robots/nomnom/issues/events{/number}","events_url":"https://api.github.com/repos/infinite-robots/nomnom/events","assignees_url":"https://api.github.com/repos/infinite-robots/nomnom/assignees{/user}","branches_url":"https://api.github.com/repos/infinite-robots/nomnom/branches{/branch}","tags_url":"https://api.github.com/repos/infinite-robots/nomnom/tags","blobs_url":"https://api.github.com/repos/infinite-robots/nomnom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infinite-robots/nomnom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infinite-robots/nomnom/git/refs{/sha}","trees_url":"https://api.github.com/repos/infinite-robots/nomnom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infinite-robots/nomnom/statuses/{sha}","languages_url":"https://api.github.com/repos/infinite-robots/nomnom/languages","stargazers_url":"https://api.github.com/repos/infinite-robots/nomnom/stargazers","contributors_url":"https://api.github.com/repos/infinite-robots/nomnom/contributors","subscribers_url":"https://api.github.com/repos/infinite-robots/nomnom/subscribers","subscription_url":"https://api.github.com/repos/infinite-robots/nomnom/subscription","commits_url":"https://api.github.com/repos/infinite-robots/nomnom/commits{/sha}","git_commits_url":"https://api.github.com/repos/infinite-robots/nomnom/git/commits{/sha}","comments_url":"https://api.github.com/repos/infinite-robots/nomnom/comments{/number}","issue_comment_url":"https://api.github.com/repos/infinite-robots/nomnom/issues/comments{/number}","contents_url":"https://api.github.com/repos/infinite-robots/nomnom/contents/{+path}","compare_url":"https://api.github.com/repos/infinite-robots/nomnom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infinite-robots/nomnom/merges","archive_url":"https://api.github.com/repos/infinite-robots/nomnom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infinite-robots/nomnom/downloads","issues_url":"https://api.github.com/repos/infinite-robots/nomnom/issues{/number}","pulls_url":"https://api.github.com/repos/infinite-robots/nomnom/pulls{/number}","milestones_url":"https://api.github.com/repos/infinite-robots/nomnom/milestones{/number}","notifications_url":"https://api.github.com/repos/infinite-robots/nomnom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infinite-robots/nomnom/labels{/name}","releases_url":"https://api.github.com/repos/infinite-robots/nomnom/releases{/id}","deployments_url":"https://api.github.com/repos/infinite-robots/nomnom/deployments","created_at":"2018-08-09T15:29:55Z","updated_at":"2018-10-12T15:39:09Z","pushed_at":"2018-10-13T12:13:50Z","git_url":"git://github.com/infinite-robots/nomnom.git","ssh_url":"git@github.com:infinite-robots/nomnom.git","clone_url":"https://github.com/infinite-robots/nomnom.git","svn_url":"https://github.com/infinite-robots/nomnom","homepage":"http://nomnom.site","size":147,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":3,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8"},"html":{"href":"https://github.com/infinite-robots/nomnom/pull/8"},"issue":{"href":"https://api.github.com/repos/infinite-robots/nomnom/issues/8"},"comments":{"href":"https://api.github.com/repos/infinite-robots/nomnom/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infinite-robots/nomnom/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/infinite-robots/nomnom/statuses/7a893d6f357c1bbe88657d8934738fc403e58535"}},"author_association":"NONE"}}
{"actor":{"display_login":"maccyber"}}