feat(change_detection): implement a change detector generator
This commit is contained in:
@@ -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;}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user