GitHub PullRequestReviewCommentEvent at 2014-08-29 04:18:13
Repository: angular.js
Actor: IgorMinar
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/16881203","id":16881203,"diff_hunk":"@@ -413,9 +413,17 @@ var selectDirective = ['$compile', '$parse', function($compile,   $parse) {\n \n         ctrl.$render = render;\n \n-        scope.$watchCollection(valuesFn, render);\n+        scope.$watchCollection(valuesFn, function () {\n+          if (scope.$$postDigestQueue.indexOf(render) === -1) {","path":"src/ng/directive/select.js","position":6,"original_position":6,"commit_id":"8391fbf7f06d929b5abe00b14e6972ac490451af","original_commit_id":"8391fbf7f06d929b5abe00b14e6972ac490451af","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=2","gravatar_id":"fc5dc0d579fb554752763792a2d5f449","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"body":"instead of doing indexOf you could just have a internal boolean flag `renderScheduled` and set it to true when you schedule via postDigest and in postDigest reset it to false.","created_at":"2014-08-29T04:18:13Z","updated_at":"2014-08-29T04:18:13Z","html_url":"https://github.com/angular/angular.js/pull/8825#discussion_r16881203","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/8825","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/16881203"},"html":{"href":"https://github.com/angular/angular.js/pull/8825#discussion_r16881203"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8825"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/8825","id":20480424,"html_url":"https://github.com/angular/angular.js/pull/8825","diff_url":"https://github.com/angular/angular.js/pull/8825.diff","patch_url":"https://github.com/angular/angular.js/pull/8825.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/8825","number":8825,"state":"open","locked":false,"title":"perf(select): Execute render after $digest cycle","user":{"login":"wesleycho","id":1703387,"avatar_url":"https://avatars.githubusercontent.com/u/1703387?v=2","gravatar_id":"2e6f4536aa1e1ec573c61d0fc905a7af","url":"https://api.github.com/users/wesleycho","html_url":"https://github.com/wesleycho","followers_url":"https://api.github.com/users/wesleycho/followers","following_url":"https://api.github.com/users/wesleycho/following{/other_user}","gists_url":"https://api.github.com/users/wesleycho/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleycho/subscriptions","organizations_url":"https://api.github.com/users/wesleycho/orgs","repos_url":"https://api.github.com/users/wesleycho/repos","events_url":"https://api.github.com/users/wesleycho/events{/privacy}","received_events_url":"https://api.github.com/users/wesleycho/received_events","type":"User","site_admin":false},"body":"This is an optimization to defer execution of the render function in the\r\nselect directive after the $digest cycle completes inside the\r\n$watchCollection expressions.  This does a check to see if the render\r\nfunction is already registered in the $$postDigestQueue before it passes\r\nit into $$postDigest, guaranteeing that the DOM manipulation happens\r\nonly in one execution after the model settles.","created_at":"2014-08-29T03:46:55Z","updated_at":"2014-08-29T04:18:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"784c96b4872d8e381fb626f54644eb8a98631c6b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/8825/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/8825/comments","review_comment_url":"https://api.github.com/repos/angular/angular.js/pulls/comments/{number}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/8825/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/8391fbf7f06d929b5abe00b14e6972ac490451af","head":{"label":"wesleycho:select_optimization","ref":"select_optimization","sha":"8391fbf7f06d929b5abe00b14e6972ac490451af","user":{"login":"wesleycho","id":1703387,"avatar_url":"https://avatars.githubusercontent.com/u/1703387?v=2","gravatar_id":"2e6f4536aa1e1ec573c61d0fc905a7af","url":"https://api.github.com/users/wesleycho","html_url":"https://github.com/wesleycho","followers_url":"https://api.github.com/users/wesleycho/followers","following_url":"https://api.github.com/users/wesleycho/following{/other_user}","gists_url":"https://api.github.com/users/wesleycho/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleycho/subscriptions","organizations_url":"https://api.github.com/users/wesleycho/orgs","repos_url":"https://api.github.com/users/wesleycho/repos","events_url":"https://api.github.com/users/wesleycho/events{/privacy}","received_events_url":"https://api.github.com/users/wesleycho/received_events","type":"User","site_admin":false},"repo":{"id":10172119,"name":"angular.js","full_name":"wesleycho/angular.js","owner":{"login":"wesleycho","id":1703387,"avatar_url":"https://avatars.githubusercontent.com/u/1703387?v=2","gravatar_id":"2e6f4536aa1e1ec573c61d0fc905a7af","url":"https://api.github.com/users/wesleycho","html_url":"https://github.com/wesleycho","followers_url":"https://api.github.com/users/wesleycho/followers","following_url":"https://api.github.com/users/wesleycho/following{/other_user}","gists_url":"https://api.github.com/users/wesleycho/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleycho/subscriptions","organizations_url":"https://api.github.com/users/wesleycho/orgs","repos_url":"https://api.github.com/users/wesleycho/repos","events_url":"https://api.github.com/users/wesleycho/events{/privacy}","received_events_url":"https://api.github.com/users/wesleycho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wesleycho/angular.js","description":"","fork":true,"url":"https://api.github.com/repos/wesleycho/angular.js","forks_url":"https://api.github.com/repos/wesleycho/angular.js/forks","keys_url":"https://api.github.com/repos/wesleycho/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wesleycho/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wesleycho/angular.js/teams","hooks_url":"https://api.github.com/repos/wesleycho/angular.js/hooks","issue_events_url":"https://api.github.com/repos/wesleycho/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/wesleycho/angular.js/events","assignees_url":"https://api.github.com/repos/wesleycho/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/wesleycho/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/wesleycho/angular.js/tags","blobs_url":"https://api.github.com/repos/wesleycho/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wesleycho/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wesleycho/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/wesleycho/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wesleycho/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/wesleycho/angular.js/languages","stargazers_url":"https://api.github.com/repos/wesleycho/angular.js/stargazers","contributors_url":"https://api.github.com/repos/wesleycho/angular.js/contributors","subscribers_url":"https://api.github.com/repos/wesleycho/angular.js/subscribers","subscription_url":"https://api.github.com/repos/wesleycho/angular.js/subscription","commits_url":"https://api.github.com/repos/wesleycho/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/wesleycho/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/wesleycho/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/wesleycho/angular.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/wesleycho/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/wesleycho/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wesleycho/angular.js/merges","archive_url":"https://api.github.com/repos/wesleycho/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wesleycho/angular.js/downloads","issues_url":"https://api.github.com/repos/wesleycho/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/wesleycho/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/wesleycho/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/wesleycho/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wesleycho/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/wesleycho/angular.js/releases{/id}","created_at":"2013-05-20T12:21:53Z","updated_at":"2014-03-20T03:56:56Z","pushed_at":"2014-08-29T03:46:27Z","git_url":"git://github.com/wesleycho/angular.js.git","ssh_url":"git@github.com:wesleycho/angular.js.git","clone_url":"https://github.com/wesleycho/angular.js.git","svn_url":"https://github.com/wesleycho/angular.js","homepage":"http://angularjs.org","size":53520,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"cb73a37c7cae5cdebadf7b3ddd44c5a452495e4e","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=2","gravatar_id":"f0d91e5cf8ad1ce7972cc486baa20c42","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":460078,"name":"angular.js","full_name":"angular/angular.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=2","gravatar_id":"f0d91e5cf8ad1ce7972cc486baa20c42","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.js","description":"HTML enhanced for web apps","fork":false,"url":"https://api.github.com/repos/angular/angular.js","forks_url":"https://api.github.com/repos/angular/angular.js/forks","keys_url":"https://api.github.com/repos/angular/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.js/teams","hooks_url":"https://api.github.com/repos/angular/angular.js/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.js/events","assignees_url":"https://api.github.com/repos/angular/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.js/tags","blobs_url":"https://api.github.com/repos/angular/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.js/languages","stargazers_url":"https://api.github.com/repos/angular/angular.js/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.js/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.js/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.js/subscription","commits_url":"https://api.github.com/repos/angular/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/angular/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.js/merges","archive_url":"https://api.github.com/repos/angular/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.js/downloads","issues_url":"https://api.github.com/repos/angular/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.js/releases{/id}","created_at":"2010-01-06T00:34:37Z","updated_at":"2014-08-29T03:38:51Z","pushed_at":"2014-08-29T03:47:12Z","git_url":"git://github.com/angular/angular.js.git","ssh_url":"git@github.com:angular/angular.js.git","clone_url":"https://github.com/angular/angular.js.git","svn_url":"https://github.com/angular/angular.js","homepage":"http://angularjs.org","size":216136,"stargazers_count":27906,"watchers_count":27906,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":10252,"mirror_url":null,"open_issues_count":1130,"forks":10252,"open_issues":1130,"watchers":27906,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8825"},"html":{"href":"https://github.com/angular/angular.js/pull/8825"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/8825"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/8825/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8825/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8825/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/8391fbf7f06d929b5abe00b14e6972ac490451af"}}}}