range() operator

This operator lets you specify a range, a number to start from and a number to end on. This is a nice shorthand that quickly lets you create a stream with a range of numbers. To use it, simply type:

// creation-operators/range.jsconst stream$ = Rx.Observable.range(1,99);stream$.subscribe(data => console.log(data));// emits 1... 99 

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.