doOnData method

Stream<T> doOnData(
  1. void onData(
    1. T event
    )
)

Invokes the given callback function when the stream emits an item. In other implementations, this is called doOnNext.

Example

Stream.fromIterable([1, 2, 3])
  .doOnData(print)
  .listen(null); // prints 1, 2, 3

Implementation

Stream<T> doOnData(void Function(T event) onData) =>
    DoStreamTransformer<T>(onData: onData).bind(this);