WindowCountStreamTransformer<T> class

Buffers a number of values from the source Observable by count then emits the buffer as a Stream 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

Observable.range(1, 4)
  .windowCount(2)
  .asyncMap((stream) => stream.toList())
  .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.

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

Constructors

WindowCountStreamTransformer(int count, [ int startBufferEvery = 0 ])

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
transformer → StreamTransformer<T, Stream<T>>
final, inherited

Methods

bind(Stream<T> stream) → Stream<Stream<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 ==(dynamic other) → bool
The equality operator.
inherited