Sha256: 890389f6a4217ee8cd8279ced4271aebf43c34cb7a0e068d76c6f7d5048583bd

Contents?: true

Size: 1.85 KB

Versions: 49

Compression:

Stored size: 1.85 KB

Contents

import { Observable } from '../Observable';
/**
 * Buffers the source Observable values until the size hits the maximum
 * `bufferSize` given.
 *
 * <span class="informal">Collects values from the past as an array, and emits
 * that array only when its size reaches `bufferSize`.</span>
 *
 * <img src="./img/bufferCount.png" width="100%">
 *
 * Buffers a number of values from the source Observable by `bufferSize` then
 * emits the buffer and clears it, and starts a new buffer each
 * `startBufferEvery` values. If `startBufferEvery` is not provided or is
 * `null`, then new buffers are started immediately at the start of the source
 * and when each buffer closes and is emitted.
 *
 * @example <caption>Emit the last two click events as an array</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferCount(2);
 * buffered.subscribe(x => console.log(x));
 *
 * @example <caption>On every click, emit the last two click events as an array</caption>
 * var clicks = Rx.Observable.fromEvent(document, 'click');
 * var buffered = clicks.bufferCount(2, 1);
 * buffered.subscribe(x => console.log(x));
 *
 * @see {@link buffer}
 * @see {@link bufferTime}
 * @see {@link bufferToggle}
 * @see {@link bufferWhen}
 * @see {@link pairwise}
 * @see {@link windowCount}
 *
 * @param {number} bufferSize The maximum size of the buffer emitted.
 * @param {number} [startBufferEvery] Interval at which to start a new buffer.
 * For 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.
 * @return {Observable<T[]>} An Observable of arrays of buffered values.
 * @method bufferCount
 * @owner Observable
 */
export declare function bufferCount<T>(this: Observable<T>, bufferSize: number, startBufferEvery?: number): Observable<T[]>;

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
govuk_publishing_components-17.8.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.7.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.6.1 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.6.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.5.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.4.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.3.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.2.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.1.1 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.1.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-17.0.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.29.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.28.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.27.1 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.27.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.26.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.25.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.24.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.23.0 node_modules/rxjs/operator/bufferCount.d.ts
govuk_publishing_components-16.22.0 node_modules/rxjs/operator/bufferCount.d.ts