DoExtensions<T> extension

Extends the Stream class with the ability to execute a callback function at different points in the Stream's lifecycle.

on
  • Stream<T>

Methods

doOnCancel(void onCancel()) → Stream<T>
Invokes the given callback function when the stream subscription is cancelled. Often called doOnUnsubscribe or doOnDispose in other implementations. [...]
doOnData(void onData(T event)) → Stream<T>
Invokes the given callback function when the stream emits an item. In other implementations, this is called doOnNext. [...]
doOnDone(void onDone()) → Stream<T>
Invokes the given callback function when the stream finishes emitting items. In other implementations, this is called doOnComplete(d). [...]
doOnEach(void onEach(Notification<T> notification)) → Stream<T>
Invokes the given callback function when the stream emits data, emits an error, or emits done. The callback receives a Notification object. [...]
doOnError(Function onError) → Stream<T>
Invokes the given callback function when the stream emits an error. [...]
doOnListen(void onListen()) → Stream<T>
Invokes the given callback function when the stream is first listened to. [...]
doOnPause(void onPause(Future resumeSignal)) → Stream<T>
Invokes the given callback function when the stream subscription is paused. [...]
doOnResume(void onResume()) → Stream<T>
Invokes the given callback function when the stream subscription resumes receiving items. [...]