1234567891011121314151617181920212223242526272829303132333435
  1. import { Observable } from '../Observable';
  2. /**
  3. * Skip the last `count` values emitted by the source Observable.
  4. *
  5. * <img src="./img/skipLast.png" width="100%">
  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 <caption>Skip the last 2 values of an Observable with many values</caption>
  13. * var many = Rx.Observable.range(1, 5);
  14. * var skipLastTwo = many.skipLast(2);
  15. * skipLastTwo.subscribe(x => console.log(x));
  16. *
  17. * // Results in:
  18. * // 1 2 3
  19. *
  20. * @see {@link skip}
  21. * @see {@link skipUntil}
  22. * @see {@link skipWhile}
  23. * @see {@link take}
  24. *
  25. * @throws {ArgumentOutOfRangeError} When using `skipLast(i)`, it throws
  26. * ArgumentOutOrRangeError if `i < 0`.
  27. *
  28. * @param {number} count Number of elements to skip from the end of the source Observable.
  29. * @returns {Observable<T>} An Observable that skips the last count values
  30. * emitted by the source Observable.
  31. * @method skipLast
  32. * @owner Observable
  33. */
  34. export declare function skipLast<T>(this: Observable<T>, count: number): Observable<T>;