We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc50829 commit 2c201d3Copy full SHA for 2c201d3
modules/angular2/src/core/facade/async.dart
@@ -61,6 +61,10 @@ class ObservableWrapper {
61
static Stream fromPromise(Future f) {
62
return new Stream.fromFuture(f);
63
}
64
+
65
+ static Future toPromise(Stream s) {
66
+ return s.single;
67
+ }
68
69
70
class EventEmitter<T> extends Stream<T> {
modules/angular2/src/core/facade/async.ts
@@ -48,6 +48,8 @@ export class ObservableWrapper {
48
static fromPromise(promise: Promise<any>): Observable<any> {
49
return RxObservable.fromPromise(promise);
50
51
52
+ static toPromise(obj: Observable<any>): Promise<any> { return (<any>obj).toPromise(); }
53
54
55
/**
0 commit comments