DoExtensions<T> extension

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

on

Methods

doOnCancel(FutureOr<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(StreamNotification<T> notification)) Stream<T>
Invokes the given callback function when the stream emits data, emits an error, or emits done. The callback receives a StreamNotification object.
doOnError(void onError(Object, StackTrace)) 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()) 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.