Observable<T>.fromFuture constructor

Observable<T>.fromFuture(Future<T> future)

Creates an Observable from the future.

When the future completes, the stream will fire one event, either data or error, and then close with a done-event.

Example

new Observable.fromFuture(new Future.value("Hello"))
  .listen(print); // prints "Hello"

Implementation

factory Observable.fromFuture(Future<T> future) =>
    Observable<T>((Stream<T>.fromFuture(future)));