feat(change_detection): added async pipe

This commit is contained in:
vsavkin
2015-04-19 12:45:08 -07:00
parent 8b3c808cb0
commit a97a2266d3
6 changed files with 260 additions and 1 deletions
+8
View File
@@ -37,6 +37,14 @@ class ObservableWrapper {
return s.listen(onNext, onError: onError, onDone: onComplete, cancelOnError: true);
}
static bool isObservable(obs) {
return obs is Stream;
}
static void dispose(StreamSubscription s) {
s.cancel();
}
static void callNext(EventEmitter emitter, value) {
emitter.add(value);
}
+8
View File
@@ -58,6 +58,14 @@ export class ObservableWrapper {
return emitter.observer({next: onNext, throw: onThrow, return: onReturn});
}
static dispose(subscription:any) {
subscription.dispose();
}
static isObservable(obs):boolean {
return obs instanceof Observable;
}
static callNext(emitter:EventEmitter, value:any) {
emitter.next(value);
}
+4
View File
@@ -54,6 +54,10 @@ export class ObservableWrapper {
return emitter.observer({next: onNext, throw: onThrow, return: onReturn});
}
static isObservable(obs: any): boolean { return obs instanceof Observable; }
static dispose(subscription: any) { subscription.dispose(); }
static callNext(emitter: EventEmitter, value: any) { emitter.next(value); }
static callThrow(emitter: EventEmitter, error: any) { emitter.throw(error); }