source: trip-planner-front/node_modules/rxjs/internal/operators/buffer.d.ts@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1import { Observable } from '../Observable';
2import { OperatorFunction } from '../types';
3/**
4 * Buffers the source Observable values until `closingNotifier` emits.
5 *
6 * <span class="informal">Collects values from the past as an array, and emits
7 * that array only when another Observable emits.</span>
8 *
9 * ![](buffer.png)
10 *
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.
15 *
16 * ## Example
17 *
18 * On every click, emit array of most recent interval events
19 *
20 * ```ts
21 * import { fromEvent, interval } from 'rxjs';
22 * import { buffer } from 'rxjs/operators';
23 *
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));
28 * ```
29 *
30 * @see {@link bufferCount}
31 * @see {@link bufferTime}
32 * @see {@link bufferToggle}
33 * @see {@link bufferWhen}
34 * @see {@link window}
35 *
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
39 * values.
40 * @method buffer
41 * @owner Observable
42 */
43export declare function buffer<T>(closingNotifier: Observable<any>): OperatorFunction<T, T[]>;
Note: See TracBrowser for help on using the repository browser.