source: trip-planner-front/node_modules/rxjs/_esm2015/internal/observable/range.js@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1import { Observable } from '../Observable';
2export function range(start = 0, count, scheduler) {
3 return new Observable(subscriber => {
4 if (count === undefined) {
5 count = start;
6 start = 0;
7 }
8 let index = 0;
9 let current = start;
10 if (scheduler) {
11 return scheduler.schedule(dispatch, 0, {
12 index, count, start, subscriber
13 });
14 }
15 else {
16 do {
17 if (index++ >= count) {
18 subscriber.complete();
19 break;
20 }
21 subscriber.next(current++);
22 if (subscriber.closed) {
23 break;
24 }
25 } while (true);
26 }
27 return undefined;
28 });
29}
30export function dispatch(state) {
31 const { start, index, count, subscriber } = state;
32 if (index >= count) {
33 subscriber.complete();
34 return;
35 }
36 subscriber.next(start);
37 if (subscriber.closed) {
38 return;
39 }
40 state.index = index + 1;
41 state.start = start + 1;
42 this.schedule(state);
43}
44//# sourceMappingURL=range.js.map
Note: See TracBrowser for help on using the repository browser.