autoConnect method

Observable<T> autoConnect ({void connection(StreamSubscription<T> subscription) })

Returns an Observable that automatically connects (at most once) to this ConnectableObservable when the first Observer subscribes.

To disconnect from the source Stream, provide a connection callback and cancel the subscription at the appropriate time.

Implementation

Observable<T> autoConnect({
  void Function(StreamSubscription<T> subscription) connection,
});