defer<T> function

Observable<T> defer <T>(
  1. Map0<Observable<T>> callback
)

Creates an Observable that uses the provided callback to create a new Observable on each subscribe.

Implementation

Observable<T> defer<T>(Map0<Observable<T>> callback) => create<T>((emitter) {
      final observable = callback() ?? empty<T>();
      emitter.add(observable.subscribe(emitter));
    });