{"action":"created","comment":{"url":"https://api.github.com/repos/jlongster/debugger.html/pulls/comments/65611291","id":65611291,"diff_hunk":"@@ -12,17 +12,35 @@ const { getSource, getSourceText } = require(\"../selectors\");\n const constants = require(\"../constants\");\n const Prefs = require(\"../prefs\");\n \n-// delay is in ms\n-const FETCH_SOURCE_RESPONSE_DELAY = 200;\n+/**\n+ * Throttles source dispatching to reduce rendering churn.\n+ */\n+let newSources = [];\n+let newSourceTimeout;\n+function queueSourcesDispatch(dispatch) {\n+  if(!newSourceTimeout) {\n+    // Even just batching every 10ms works because we just want to\n+    // group sources that come in at once.\n+    newSourceTimeout = setTimeout(() => {\n+      dispatch({ type: constants.ADD_SOURCES,\n+                 sources: newSources });\n+      newSources = [];\n+      newSourceTimeout = null;\n+    }, 10);\n+  }\n+}","path":"public/js/actions/sources.js","position":22,"original_position":22,"commit_id":"e9e456f2740b414b3094e3e12df746d8fd8b208f","original_commit_id":"0d8fd01f5cc22ff6a4ba990e3657163376d29fff","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"body":"It might be nice to put a simple debounce function in util and use that\r\n\r\n```js\r\nconst newSources = debounce(function(dispatch) {\r\n  dispatch({ \r\n    type: constants.ADD_SOURCES,\r\n    sources: newSourcesList\r\n  });\r\n  newSourcesList = [];\r\n}); \r\n```","created_at":"2016-06-02T20:21:31Z","updated_at":"2016-06-02T20:21:31Z","html_url":"https://github.com/jlongster/debugger.html/pull/235#discussion_r65611291","pull_request_url":"https://api.github.com/repos/jlongster/debugger.html/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/comments/65611291"},"html":{"href":"https://github.com/jlongster/debugger.html/pull/235#discussion_r65611291"},"pull_request":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/jlongster/debugger.html/pulls/235","id":72397553,"html_url":"https://github.com/jlongster/debugger.html/pull/235","diff_url":"https://github.com/jlongster/debugger.html/pull/235.diff","patch_url":"https://github.com/jlongster/debugger.html/pull/235.patch","issue_url":"https://api.github.com/repos/jlongster/debugger.html/issues/235","number":235,"state":"open","locked":false,"title":"batch newSource dispatches to reduce rendering churn","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-02T18:47:59Z","updated_at":"2016-06-02T20:21:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4feee1fe4fe02a9ea6d0b3f226fa15472fa51dff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jlongster/debugger.html/pulls/235/commits","review_comments_url":"https://api.github.com/repos/jlongster/debugger.html/pulls/235/comments","review_comment_url":"https://api.github.com/repos/jlongster/debugger.html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jlongster/debugger.html/issues/235/comments","statuses_url":"https://api.github.com/repos/jlongster/debugger.html/statuses/e9e456f2740b414b3094e3e12df746d8fd8b208f","head":{"label":"jlongster:batch-sources","ref":"batch-sources","sha":"e9e456f2740b414b3094e3e12df746d8fd8b208f","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"repo":{"id":54585418,"name":"debugger.html","full_name":"jlongster/debugger.html","owner":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlongster/debugger.html","description":"An experimental debugger interface.","fork":false,"url":"https://api.github.com/repos/jlongster/debugger.html","forks_url":"https://api.github.com/repos/jlongster/debugger.html/forks","keys_url":"https://api.github.com/repos/jlongster/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlongster/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlongster/debugger.html/teams","hooks_url":"https://api.github.com/repos/jlongster/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/jlongster/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/jlongster/debugger.html/events","assignees_url":"https://api.github.com/repos/jlongster/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/jlongster/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/jlongster/debugger.html/tags","blobs_url":"https://api.github.com/repos/jlongster/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlongster/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlongster/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlongster/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlongster/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/jlongster/debugger.html/languages","stargazers_url":"https://api.github.com/repos/jlongster/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/jlongster/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/jlongster/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/jlongster/debugger.html/subscription","commits_url":"https://api.github.com/repos/jlongster/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlongster/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlongster/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlongster/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlongster/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/jlongster/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlongster/debugger.html/merges","archive_url":"https://api.github.com/repos/jlongster/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlongster/debugger.html/downloads","issues_url":"https://api.github.com/repos/jlongster/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/jlongster/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/jlongster/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/jlongster/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlongster/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/jlongster/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/jlongster/debugger.html/deployments","created_at":"2016-03-23T18:55:36Z","updated_at":"2016-06-02T19:23:46Z","pushed_at":"2016-06-02T20:21:29Z","git_url":"git://github.com/jlongster/debugger.html.git","ssh_url":"git@github.com:jlongster/debugger.html.git","clone_url":"https://github.com/jlongster/debugger.html.git","svn_url":"https://github.com/jlongster/debugger.html","homepage":"","size":731,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":38,"forks":14,"open_issues":38,"watchers":63,"default_branch":"master"}},"base":{"label":"jlongster:master","ref":"master","sha":"cb15b815e06edb017ac8678301e28c5bb95e6b65","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"repo":{"id":54585418,"name":"debugger.html","full_name":"jlongster/debugger.html","owner":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlongster/debugger.html","description":"An experimental debugger interface.","fork":false,"url":"https://api.github.com/repos/jlongster/debugger.html","forks_url":"https://api.github.com/repos/jlongster/debugger.html/forks","keys_url":"https://api.github.com/repos/jlongster/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlongster/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlongster/debugger.html/teams","hooks_url":"https://api.github.com/repos/jlongster/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/jlongster/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/jlongster/debugger.html/events","assignees_url":"https://api.github.com/repos/jlongster/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/jlongster/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/jlongster/debugger.html/tags","blobs_url":"https://api.github.com/repos/jlongster/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlongster/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlongster/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlongster/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlongster/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/jlongster/debugger.html/languages","stargazers_url":"https://api.github.com/repos/jlongster/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/jlongster/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/jlongster/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/jlongster/debugger.html/subscription","commits_url":"https://api.github.com/repos/jlongster/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlongster/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlongster/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlongster/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlongster/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/jlongster/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlongster/debugger.html/merges","archive_url":"https://api.github.com/repos/jlongster/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlongster/debugger.html/downloads","issues_url":"https://api.github.com/repos/jlongster/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/jlongster/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/jlongster/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/jlongster/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlongster/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/jlongster/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/jlongster/debugger.html/deployments","created_at":"2016-03-23T18:55:36Z","updated_at":"2016-06-02T19:23:46Z","pushed_at":"2016-06-02T20:21:29Z","git_url":"git://github.com/jlongster/debugger.html.git","ssh_url":"git@github.com:jlongster/debugger.html.git","clone_url":"https://github.com/jlongster/debugger.html.git","svn_url":"https://github.com/jlongster/debugger.html","homepage":"","size":731,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":38,"forks":14,"open_issues":38,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/235"},"html":{"href":"https://github.com/jlongster/debugger.html/pull/235"},"issue":{"href":"https://api.github.com/repos/jlongster/debugger.html/issues/235"},"comments":{"href":"https://api.github.com/repos/jlongster/debugger.html/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jlongster/debugger.html/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/jlongster/debugger.html/statuses/e9e456f2740b414b3094e3e12df746d8fd8b208f"}}}}
{"actor":{"display_login":"jasonLaster"}}