Table of Contents

Class BufferOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

The buffer operator.

public static class BufferOperator
Inheritance
System.Object
BufferOperator

Methods

Buffer<T, TNotifier>(Observable<T>, Observable<TNotifier>)

Buffers source's values into an array, emitted each time closingNotifier emits, then starts a new, empty buffer. Mirrors rxjs's buffer. Same boundary-observable idea as Window<T, TBoundary>(Observable<T>, Observable<TBoundary>), but collecting into arrays instead of live windows: closingNotifier is subscribed exactly once, for the whole lifetime of the output. If source completes while a buffer is still open (regardless of whether it has any values), that buffer is emitted before completion is forwarded.

public static Observable<IReadOnlyList<T>> Buffer<T, TNotifier>(this Observable<T> source, Observable<TNotifier> closingNotifier)

Parameters

source Observable<T>

The source observable to buffer.

closingNotifier Observable<TNotifier>

Each emission closes the current buffer (emitting it) and opens a new one.

Returns

Observable<IReadOnlyList<T>>

An observable of each completed (or trailing) buffer as an IReadOnlyList<T>.

Type Parameters

T

The type of the elements collected into each buffer.

TNotifier

The (unused) element type of closingNotifier.