{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/34848031","id":34848031,"diff_hunk":"@@ -4,15 +4,87 @@ import 'package:observe/observe.dart' show ObservableList;\n import 'package:angular2/change_detection.dart';\n import 'package:angular2/src/change_detection/pipes/iterable_changes.dart';\n import 'dart:async';\n+import 'package:angular2/src/facade/lang.dart';\n \n-class ObservableListDiff extends IterableChanges {\n-  ChangeDetectorRef _ref;\n-  ObservableListDiff(this._ref);\n+class ChangeRecord implements IIterableChangeRecord {\n+  int currentIndex;\n+  int previousIndex;\n+  dynamic item;\n+\n+  ChangeRecord(this.item, this.previousIndex, this.currentIndex);\n+\n+  String toString() {\n+    return this.previousIndex == this.currentIndex ?\n+    stringify(this.item) :\n+    stringify(this.item) + '[' + stringify(this.previousIndex) + '->' +\n+    stringify(this.currentIndex) + ']';\n+  }\n+}\n \n-  bool _updated = true;\n+class ObservableListDiffResult implements IIterableChangesResult {\n   ObservableList _collection;\n+  List _records = [];\n+\n+  ObservableListDiffResult(this._collection, this._records);\n+\n+  void forEachAddedItem(Function fn) {\n+    _records.forEach((r) {\n+      if (r.addedCount > 0) {\n+        for (var i = 0; i < r.addedCount; ++i) {\n+          final currentIndex = r.index + i;\n+          final item = _collection[currentIndex];\n+          fn(new ChangeRecord(item, null, currentIndex));\n+        }\n+      }\n+    });\n+  }\n+\n+  void forEachMovedItem(Function fn) {\n+    // do not support moves\n+  }\n+\n+  void forEachRemovedItem(Function fn) {\n+    _records.forEach((r) {\n+      if (! r.removed.isEmpty) {\n+        for (var i = 0; i < r.removed.length; ++i) {\n+          final currentIndex = r.index + i;\n+          fn(new ChangeRecord(r.removed[i], currentIndex, null));\n+        }\n+      }\n+    });\n+  }\n+\n+  String toString() {\n+    var additions = [];\n+    forEachAddedItem(additions.add);\n+\n+    var moves = [];\n+    forEachMovedItem(moves.add);\n+\n+    var removals = [];\n+    forEachRemovedItem(removals.add);\n+\n+    return \"additions: ${additions.join(\", \")} moves: ${moves.join(\", \")} removals: ${removals.join(\", \")}\";\n+  }\n+}\n+\n+class ObservableListDiff implements Pipe {\n+  // a set of changes between two change detection runs\n+  ObservableListDiffResult diff;\n+\n+  // a set of changes we are collecting between two change detection runs\n+  List _listChanges = [];","path":"modules/angular2/src/directives/observable_list_diff.dart","position":77,"original_position":77,"commit_id":"233498a7a28b455a4412cfb149f5c4c552caef64","original_commit_id":"233498a7a28b455a4412cfb149f5c4c552caef64","user":{"login":"yjbanov","id":211513,"avatar_url":"https://avatars.githubusercontent.com/u/211513?v=3","gravatar_id":"","url":"https://api.github.com/users/yjbanov","html_url":"https://github.com/yjbanov","followers_url":"https://api.github.com/users/yjbanov/followers","following_url":"https://api.github.com/users/yjbanov/following{/other_user}","gists_url":"https://api.github.com/users/yjbanov/gists{/gist_id}","starred_url":"https://api.github.com/users/yjbanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjbanov/subscriptions","organizations_url":"https://api.github.com/users/yjbanov/orgs","repos_url":"https://api.github.com/users/yjbanov/repos","events_url":"https://api.github.com/users/yjbanov/events{/privacy}","received_events_url":"https://api.github.com/users/yjbanov/received_events","type":"User","site_admin":false},"body":"Can this list have a generic type?","created_at":"2015-07-16T23:05:10Z","updated_at":"2015-07-16T23:05:10Z","html_url":"https://github.com/angular/angular/pull/3099#discussion_r34848031","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/3099","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/34848031"},"html":{"href":"https://github.com/angular/angular/pull/3099#discussion_r34848031"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/3099"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/3099","id":40182309,"html_url":"https://github.com/angular/angular/pull/3099","diff_url":"https://github.com/angular/angular/pull/3099.diff","patch_url":"https://github.com/angular/angular/pull/3099.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/3099","number":3099,"state":"open","locked":false,"title":"ObservableList without dirty checking","user":{"login":"vsavkin","id":35996,"avatar_url":"https://avatars.githubusercontent.com/u/35996?v=3","gravatar_id":"","url":"https://api.github.com/users/vsavkin","html_url":"https://github.com/vsavkin","followers_url":"https://api.github.com/users/vsavkin/followers","following_url":"https://api.github.com/users/vsavkin/following{/other_user}","gists_url":"https://api.github.com/users/vsavkin/gists{/gist_id}","starred_url":"https://api.github.com/users/vsavkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsavkin/subscriptions","organizations_url":"https://api.github.com/users/vsavkin/orgs","repos_url":"https://api.github.com/users/vsavkin/repos","events_url":"https://api.github.com/users/vsavkin/events{/privacy}","received_events_url":"https://api.github.com/users/vsavkin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-16T22:16:08Z","updated_at":"2015-07-16T23:05:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b65f419d4d35616859e3f97f5976c367c97adde0","assignee":{"login":"yjbanov","id":211513,"avatar_url":"https://avatars.githubusercontent.com/u/211513?v=3","gravatar_id":"","url":"https://api.github.com/users/yjbanov","html_url":"https://github.com/yjbanov","followers_url":"https://api.github.com/users/yjbanov/followers","following_url":"https://api.github.com/users/yjbanov/following{/other_user}","gists_url":"https://api.github.com/users/yjbanov/gists{/gist_id}","starred_url":"https://api.github.com/users/yjbanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjbanov/subscriptions","organizations_url":"https://api.github.com/users/yjbanov/orgs","repos_url":"https://api.github.com/users/yjbanov/repos","events_url":"https://api.github.com/users/yjbanov/events{/privacy}","received_events_url":"https://api.github.com/users/yjbanov/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/40","html_url":"https://github.com/angular/angular/milestones/alpha-32","labels_url":"https://api.github.com/repos/angular/angular/milestones/40/labels","id":1189877,"number":40,"title":"alpha-32","description":"Current milestone.  Work on all issues to complete by Monday July 20 @ 8am PT; sync internal/external by July 23 EOD.","creator":{"login":"naomiblack","id":2286589,"avatar_url":"https://avatars.githubusercontent.com/u/2286589?v=3","gravatar_id":"","url":"https://api.github.com/users/naomiblack","html_url":"https://github.com/naomiblack","followers_url":"https://api.github.com/users/naomiblack/followers","following_url":"https://api.github.com/users/naomiblack/following{/other_user}","gists_url":"https://api.github.com/users/naomiblack/gists{/gist_id}","starred_url":"https://api.github.com/users/naomiblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naomiblack/subscriptions","organizations_url":"https://api.github.com/users/naomiblack/orgs","repos_url":"https://api.github.com/users/naomiblack/repos","events_url":"https://api.github.com/users/naomiblack/events{/privacy}","received_events_url":"https://api.github.com/users/naomiblack/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":36,"state":"open","created_at":"2015-07-01T23:26:20Z","updated_at":"2015-07-16T22:48:29Z","due_on":"2015-07-20T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular/pulls/3099/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/3099/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/3099/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/233498a7a28b455a4412cfb149f5c4c552caef64","head":{"label":"vsavkin:cd_observable_list_2","ref":"cd_observable_list_2","sha":"233498a7a28b455a4412cfb149f5c4c552caef64","user":{"login":"vsavkin","id":35996,"avatar_url":"https://avatars.githubusercontent.com/u/35996?v=3","gravatar_id":"","url":"https://api.github.com/users/vsavkin","html_url":"https://github.com/vsavkin","followers_url":"https://api.github.com/users/vsavkin/followers","following_url":"https://api.github.com/users/vsavkin/following{/other_user}","gists_url":"https://api.github.com/users/vsavkin/gists{/gist_id}","starred_url":"https://api.github.com/users/vsavkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsavkin/subscriptions","organizations_url":"https://api.github.com/users/vsavkin/orgs","repos_url":"https://api.github.com/users/vsavkin/repos","events_url":"https://api.github.com/users/vsavkin/events{/privacy}","received_events_url":"https://api.github.com/users/vsavkin/received_events","type":"User","site_admin":false},"repo":{"id":24644769,"name":"angular","full_name":"vsavkin/angular","owner":{"login":"vsavkin","id":35996,"avatar_url":"https://avatars.githubusercontent.com/u/35996?v=3","gravatar_id":"","url":"https://api.github.com/users/vsavkin","html_url":"https://github.com/vsavkin","followers_url":"https://api.github.com/users/vsavkin/followers","following_url":"https://api.github.com/users/vsavkin/following{/other_user}","gists_url":"https://api.github.com/users/vsavkin/gists{/gist_id}","starred_url":"https://api.github.com/users/vsavkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsavkin/subscriptions","organizations_url":"https://api.github.com/users/vsavkin/orgs","repos_url":"https://api.github.com/users/vsavkin/repos","events_url":"https://api.github.com/users/vsavkin/events{/privacy}","received_events_url":"https://api.github.com/users/vsavkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vsavkin/angular","description":"","fork":true,"url":"https://api.github.com/repos/vsavkin/angular","forks_url":"https://api.github.com/repos/vsavkin/angular/forks","keys_url":"https://api.github.com/repos/vsavkin/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vsavkin/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vsavkin/angular/teams","hooks_url":"https://api.github.com/repos/vsavkin/angular/hooks","issue_events_url":"https://api.github.com/repos/vsavkin/angular/issues/events{/number}","events_url":"https://api.github.com/repos/vsavkin/angular/events","assignees_url":"https://api.github.com/repos/vsavkin/angular/assignees{/user}","branches_url":"https://api.github.com/repos/vsavkin/angular/branches{/branch}","tags_url":"https://api.github.com/repos/vsavkin/angular/tags","blobs_url":"https://api.github.com/repos/vsavkin/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vsavkin/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vsavkin/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/vsavkin/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vsavkin/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/vsavkin/angular/languages","stargazers_url":"https://api.github.com/repos/vsavkin/angular/stargazers","contributors_url":"https://api.github.com/repos/vsavkin/angular/contributors","subscribers_url":"https://api.github.com/repos/vsavkin/angular/subscribers","subscription_url":"https://api.github.com/repos/vsavkin/angular/subscription","commits_url":"https://api.github.com/repos/vsavkin/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/vsavkin/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/vsavkin/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/vsavkin/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/vsavkin/angular/contents/{+path}","compare_url":"https://api.github.com/repos/vsavkin/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vsavkin/angular/merges","archive_url":"https://api.github.com/repos/vsavkin/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vsavkin/angular/downloads","issues_url":"https://api.github.com/repos/vsavkin/angular/issues{/number}","pulls_url":"https://api.github.com/repos/vsavkin/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/vsavkin/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/vsavkin/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vsavkin/angular/labels{/name}","releases_url":"https://api.github.com/repos/vsavkin/angular/releases{/id}","created_at":"2014-09-30T15:59:47Z","updated_at":"2015-06-09T11:17:07Z","pushed_at":"2015-07-16T22:19:46Z","git_url":"git://github.com/vsavkin/angular.git","ssh_url":"git@github.com:vsavkin/angular.git","clone_url":"https://github.com/vsavkin/angular.git","svn_url":"https://github.com/vsavkin/angular","homepage":null,"size":13145,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"2147ce45c21a3598548a036c49c025eec68f625b","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","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":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","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","description":"","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","created_at":"2014-09-18T16:12:01Z","updated_at":"2015-07-16T22:55:58Z","pushed_at":"2015-07-16T22:48:26Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":"https://angular.io","size":34824,"stargazers_count":4240,"watchers_count":4240,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1110,"mirror_url":null,"open_issues_count":379,"forks":1110,"open_issues":379,"watchers":4240,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/3099"},"html":{"href":"https://github.com/angular/angular/pull/3099"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/3099"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/3099/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/3099/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/3099/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/233498a7a28b455a4412cfb149f5c4c552caef64"}}}}