1 import { MonoTypeOperatorFunction } from '../types';
3 * Emits only the first `count` values emitted by the source Observable.
5 * <span class="informal">Takes the first `count` values from the source, then
10 * `take` returns an Observable that emits only the first `count` values emitted
11 * by the source Observable. If the source emits fewer than `count` values then
12 * all of its values are emitted. After that, it completes, regardless if the
16 * Take the first 5 seconds of an infinite 1-second interval Observable
18 * import { interval } from 'rxjs';
19 * import { take } from 'rxjs/operators';
21 * const intervalCount = interval(1000);
22 * const takeFive = intervalCount.pipe(take(5));
23 * takeFive.subscribe(x => console.log(x));
33 * @see {@link takeLast}
34 * @see {@link takeUntil}
35 * @see {@link takeWhile}
38 * @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
39 * ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
41 * @param {number} count The maximum number of `next` values to emit.
42 * @return {Observable<T>} An Observable that emits only the first `count`
43 * values emitted by the source Observable, or all of the values from the source
44 * if the source emits fewer than `count` values.
48 export declare function take<T>(count: number): MonoTypeOperatorFunction<T>;