peek abstract method

DoubleStream peek(
  1. void action(
    1. double
    )
)

Applies the action to each element and returns the same stream.

Example

final result = DoubleStream.of([1.5, 2.5, 3.5])
    .peek((d) => print('Processing: $d'))
    .map((d) => d * 2)
    .toList();

Implementation

DoubleStream peek(void Function(double) action);