Open danschultz opened 9 years ago
Buffers the events in a stream for each interval period. The transformed stream will contain a list of the buffered events for each period.
var source = new Stream.periodic(new Duration(seconds: 1), (i) => i); var buffered = source.transform(new BufferPeriod(new Duration(seconds: 3))).take(2); buffered.listen((value) => print("Next: $value")); // Next: [1, 2, 3] // Next: [4, 5, 6]
Buffers the events in a stream for each interval period. The transformed stream will contain a list of the buffered events for each period.