feat(change_detection): implement a change detector generator

This commit is contained in:
vsavkin
2015-01-21 12:05:52 -08:00
parent b78c1252e5
commit 850cf0fef4
31 changed files with 1347 additions and 694 deletions
+2 -2
View File
@@ -89,8 +89,8 @@ class ListWrapper {
static reduce(List list, Function fn, init) {
return list.fold(init, fn);
}
static first(List list) => list.first;
static last(List list) => list.last;
static first(List list) => list.isEmpty ? null : list.first;
static last(List list) => list.isEmpty ? null : list.last;
static List reversed(List list) => list.reversed.toList();
static void push(List l, e) { l.add(e); }
static List concat(List a, List b) {a.addAll(b); return a;}
+1
View File
@@ -27,6 +27,7 @@ class IMPLEMENTS {
bool isPresent(obj) => obj != null;
bool isBlank(obj) => obj == null;
bool isString(obj) => obj is String;
String stringify(obj) => obj.toString();
+4
View File
@@ -27,6 +27,10 @@ export function isBlank(obj):boolean {
return obj === undefined || obj === null;
}
export function isString(obj):boolean {
return typeof obj === "string";
}
export function stringify(token):string {
if (typeof token === 'string') {
return token;