Learn RxJS
Search…
range

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

Emit numbers in provided range in sequence.

Examples

Example 1: Emit range 1-10
1
// RxJS v6+
2
import { range } from 'rxjs';
3
4
//emit 1-10 in sequence
5
const source = range(1, 10);
6
//output: 1,2,3,4,5,6,7,8,9,10
7
const example = source.subscribe(val => console.log(val));
Copied!

Additional Resources

  • range 📰 - Official docs
Last modified 1yr ago