Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | import { MonoTypeOperatorFunction } from '../types';
|
---|
2 | /**
|
---|
3 | * Skip the last `count` values emitted by the source Observable.
|
---|
4 | *
|
---|
5 | * ![](skipLast.png)
|
---|
6 | *
|
---|
7 | * `skipLast` returns an Observable that accumulates a queue with a length
|
---|
8 | * enough to store the first `count` values. As more values are received,
|
---|
9 | * values are taken from the front of the queue and produced on the result
|
---|
10 | * sequence. This causes values to be delayed.
|
---|
11 | *
|
---|
12 | * ## Example
|
---|
13 | * Skip the last 2 values of an Observable with many values
|
---|
14 | * ```ts
|
---|
15 | * import { range } from 'rxjs';
|
---|
16 | * import { skipLast } from 'rxjs/operators';
|
---|
17 | *
|
---|
18 | * const many = range(1, 5);
|
---|
19 | * const skipLastTwo = many.pipe(skipLast(2));
|
---|
20 | * skipLastTwo.subscribe(x => console.log(x));
|
---|
21 | *
|
---|
22 | * // Results in:
|
---|
23 | * // 1 2 3
|
---|
24 | * ```
|
---|
25 | *
|
---|
26 | * @see {@link skip}
|
---|
27 | * @see {@link skipUntil}
|
---|
28 | * @see {@link skipWhile}
|
---|
29 | * @see {@link take}
|
---|
30 | *
|
---|
31 | * @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws
|
---|
32 | * ArgumentOutOrRangeError if `i < 0`.
|
---|
33 | *
|
---|
34 | * @param {number} count Number of elements to skip from the end of the source Observable.
|
---|
35 | * @returns {Observable<T>} An Observable that skips the last count values
|
---|
36 | * emitted by the source Observable.
|
---|
37 | * @method skipLast
|
---|
38 | * @owner Observable
|
---|
39 | */
|
---|
40 | export declare function skipLast<T>(count: number): MonoTypeOperatorFunction<T>;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.