range

signature: range(start: number, count: number, scheduler: Scheduler): Observable

Emit numbers in provided range in sequence.

Examples

Example 1: Emit range 1-10

( jsBin | jsFiddle )

//emit 1-10 in sequence
const source = Rx.Observable.range(1,10);
//output: 1,2,3,4,5,6,7,8,9,10
const example = source.subscribe(val => console.log(val));

Additional Resources


:file_folder: Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/observable/RangeObservable.ts

results matching ""

    No results matching ""