Debian Codegraph @

node/rxjs/dist/esm5/internal/observable/range.js

raw
1 import { Observable } from '../Observable';
2 import { EMPTY } from './empty';
3 export function range(start, count, scheduler) {
4 if (count == null) {
5 count = start;
6 start = 0;
7 }
8 if (count <= 0) {
9 return EMPTY;
10 }
11 var end = count + start;
12 return new Observable(scheduler
13 ?
14 function (subscriber) {
15 var n = start;
16 return scheduler.schedule(function () {
17 if (n < end) {
18 subscriber.next(n++);
19 this.schedule();
20 }
21 else {
22 subscriber.complete();
23 }
24 });
25 }
26 :
27 function (subscriber) {
28 var n = start;
29 while (n < end && !subscriber.closed) {
30 subscriber.next(n++);
31 }
32 subscriber.complete();
33 });
34 }
35 //# sourceMappingURL=range.js.map