feat(change_detection): do not reparse AST when using generated detectors
This commit is contained in:
@@ -134,6 +134,12 @@ class ListWrapper {
|
||||
list.forEach(fn);
|
||||
}
|
||||
|
||||
static void forEachWithIndex(List list, fn(item, index)) {
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
fn(list[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
static reduce(List list, fn(a, b), init) {
|
||||
return list.fold(init, fn);
|
||||
}
|
||||
|
||||
@@ -182,6 +182,11 @@ export class ListWrapper {
|
||||
fn(array[i]);
|
||||
}
|
||||
}
|
||||
static forEachWithIndex<T>(array: List<T>, fn: (T, number) => void) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
fn(array[i], i);
|
||||
}
|
||||
}
|
||||
static first<T>(array: List<T>): T {
|
||||
if (!array) return null;
|
||||
return array[0];
|
||||
|
||||
Reference in New Issue
Block a user