Single<T>.fromFuture constructor

Single<T>.fromFuture(
  1. Future<T> future
)

Creates a new single-subscription Single from the future.

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

Marble

future: ----------a|
result: ----------a|

future: ----------x|
result: ----------x|

NOTE: x is error event

Implementation

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