RxJS implements this operator as range
. It accepts as its parameters the
start value of the range and the number of items in the range.
range
operates by default on the currentThread
Scheduler, but there is a variant that allows you to set the Scheduler by
passing one in as the optional third parameter.
Sample Code
var source = Rx.Observable.range(0, 3);
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: 2
Completed
range
is found in each of the following distributions:
rx.js
rx.compat.js
rx.lite.js
rx.lite.compat.js