1 import { MonoTypeOperatorFunction } from '../types';
3 * Emits only the last `count` values emitted by the source Observable.
5 * <span class="informal">Remembers the latest `count` values, then emits those
6 * only when the source completes.</span>
10 * `takeLast` returns an Observable that emits at most the last `count` values
11 * emitted by the source Observable. If the source emits fewer than `count`
12 * values then all of its values are emitted. This operator must wait until the
13 * `complete` notification emission from the source in order to emit the `next`
14 * values on the output Observable, because otherwise it is impossible to know
15 * whether or not more values will be emitted on the source. For this reason,
16 * all values are emitted synchronously, followed by the complete notification.
19 * Take the last 3 values of an Observable with many values
21 * import { range } from 'rxjs';
22 * import { takeLast } from 'rxjs/operators';
24 * const many = range(1, 100);
25 * const lastThree = many.pipe(takeLast(3));
26 * lastThree.subscribe(x => console.log(x));
30 * @see {@link takeUntil}
31 * @see {@link takeWhile}
34 * @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an
35 * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
37 * @param {number} count The maximum number of values to emit from the end of
38 * the sequence of values emitted by the source Observable.
39 * @return {Observable<T>} An Observable that emits at most the last count
40 * values emitted by the source Observable.
44 export declare function takeLast<T>(count: number): MonoTypeOperatorFunction<T>;