( StackBlitz | jsBin | jsFiddle )
// RxJS v6+
import { range } from 'rxjs';
//emit 1-10 in sequence
const source = range(1, 10);
//output: 1,2,3,4,5,6,7,8,9,10
const example = source.subscribe(val => console.log(val));
- range 📰 - Official docs
📁 Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/internal/observable/range.ts