source: trip-planner-front/node_modules/rxjs/internal/observable/interval.js@ eed0bf8

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

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Observable_1 = require("../Observable");
4var async_1 = require("../scheduler/async");
5var isNumeric_1 = require("../util/isNumeric");
6function interval(period, scheduler) {
7 if (period === void 0) { period = 0; }
8 if (scheduler === void 0) { scheduler = async_1.async; }
9 if (!isNumeric_1.isNumeric(period) || period < 0) {
10 period = 0;
11 }
12 if (!scheduler || typeof scheduler.schedule !== 'function') {
13 scheduler = async_1.async;
14 }
15 return new Observable_1.Observable(function (subscriber) {
16 subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
17 return subscriber;
18 });
19}
20exports.interval = interval;
21function dispatch(state) {
22 var subscriber = state.subscriber, counter = state.counter, period = state.period;
23 subscriber.next(counter);
24 this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
25}
26//# sourceMappingURL=interval.js.map
Note: See TracBrowser for help on using the repository browser.