windowTest method

Stream<Stream<T>> windowTest(
  1. bool onTestHandler(
    1. T event
    )
)

Creates a Stream where each item is a Stream containing the items from the source sequence, batched whenever test passes.

Example

Stream.periodic(Duration(milliseconds: 100), (int i) => i)
  .windowTest((i) => i % 2 == 0)
  .asyncMap((stream) => stream.toList())
  .listen(print); // prints [0], [1, 2] [3, 4] [5, 6] ...

Implementation

Stream<Stream<T>> windowTest(bool Function(T event) onTestHandler) =>
    WindowTestStreamTransformer<T>(onTestHandler).bind(this);