BufferCountStreamTransformer<T> class

Buffers a number of values from the source Stream by count then emits the buffer and clears it, and starts a new buffer each startBufferEvery values. If startBufferEvery is not provided, then new buffers are started immediately at the start of the source and when each buffer closes and is emitted.

Example

count is the maximum size of the buffer emitted

Rx.range(1, 4)
  .bufferCount(2)
  .listen(print); // prints [1, 2], [3, 4] done!

Example

if startBufferEvery is 2, then a new buffer will be started on every other value from the source. A new buffer is started at the beginning of the source by default.

Rx.range(1, 5)
  .bufferCount(3, 2)
  .listen(print); // prints [1, 2, 3], [3, 4, 5], [5] done!
Inheritance

Constructors

BufferCountStreamTransformer(int count, [int startBufferEvery = 0])
Constructs a StreamTransformer which buffers events into a List and emits this List whenever its length is equal to count. [...]

Properties

closeWindowWhen bool Function(List<T> queue)
Predicate which determines when the current window should close
final, inherited
dispatchOnClose bool
Toggle to prevent, or allow the final set of events to be dispatched when the source Stream closes
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
ignoreEmptyWindows bool
Toggle to prevent, or allow windows that contain no events to be dispatched
final, inherited
onWindowEnd List<T> Function(List<T> queue)
Handler which fires when the window closes
final, inherited
onWindowStart List<T> Function(T event)
Handler which fires when the window opens
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
startBufferEvery int
Used to skip an amount of events
final, inherited
strategy → WindowStrategy
Determines how the window is created
final, inherited
windowStreamFactory Stream Function(T event)
Factory method used to create the Stream which will be buffered
final, inherited

Methods

bind(Stream<T> stream) Stream<List<T>>
Transforms the provided stream. [...]
inherited
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited