1 import { Observable } from '../Observable';
2 import { OperatorFunction } from '../types';
4 * Buffers the source Observable values until `closingNotifier` emits.
6 * <span class="informal">Collects values from the past as an array, and emits
7 * that array only when another Observable emits.</span>
11 * Buffers the incoming Observable values until the given `closingNotifier`
12 * Observable emits a value, at which point it emits the buffer on the output
13 * Observable and starts a new buffer internally, awaiting the next time
14 * `closingNotifier` emits.
18 * On every click, emit array of most recent interval events
21 * import { fromEvent, interval } from 'rxjs';
22 * import { buffer } from 'rxjs/operators';
24 * const clicks = fromEvent(document, 'click');
25 * const intervalEvents = interval(1000);
26 * const buffered = intervalEvents.pipe(buffer(clicks));
27 * buffered.subscribe(x => console.log(x));
30 * @see {@link bufferCount}
31 * @see {@link bufferTime}
32 * @see {@link bufferToggle}
33 * @see {@link bufferWhen}
36 * @param {Observable<any>} closingNotifier An Observable that signals the
37 * buffer to be emitted on the output Observable.
38 * @return {Observable<T[]>} An Observable of buffers, which are arrays of
43 export declare function buffer<T>(closingNotifier: Observable<any>): OperatorFunction<T, T[]>;