Single<T>.defer constructor

Single<T>.defer(
  1. Single<T> singleFactory(), {
  2. bool reusable = false,
})

The defer factory waits until an observer subscribes to it, and then it creates a Single with the given factory function.

By default, this Single is a single-subscription Stream. However, it's possible to make it reusable.

See Rx.defer and DeferStream.

Implementation

factory Single.defer(Single<T> Function() singleFactory,
        {bool reusable = false}) =>
    Single.safe(Rx.defer(singleFactory, reusable: reusable));