Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
65 lines (51 loc) · 2.61 KB

skiplastwithtime.md

File metadata and controls

65 lines (51 loc) · 2.61 KB

Rx.Observable.prototype.skipLastWithTime(duration, [scheduler])

Bypasses a specified number of elements at the end of an observable sequence.

This operator accumulates a queue with a length enough to store the first count elements. As more elements are received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.

Arguments

  1. duration (Number): Duration for skipping elements from the end of the sequence.
  2. [scheduler=Rx.Scheduler.timeout] (Scheduler): Scheduler to run the timer on. If not specified, defaults to timeout scheduler.

Returns

(Observable): An observable sequence with the elements skipped during the specified duration from the end of the source sequence.

Example

var source = Rx.Observable.timer(0, 1000)
    .take(10)
    .skipLastWithTime(5000);

var subscription = source.subscribe(
    function (x) {
        console.log('Next: ' + x);
    },
    function (err) {
        console.log('Error: ' + err);
    },
    function () {
        console.log('Completed');
    });

// => Next: 0
// => Next: 1
// => Next: 3
// => Next: 4
// => Completed

Location

File:

Dist:

Prerequisites:

NPM Packages:

NuGet Packages:

Unit Tests: