Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm5 / internal / observable / interval.js
1 /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */
2 import { Observable } from '../Observable';
3 import { async } from '../scheduler/async';
4 import { isNumeric } from '../util/isNumeric';
5 export function interval(period, scheduler) {
6     if (period === void 0) {
7         period = 0;
8     }
9     if (scheduler === void 0) {
10         scheduler = async;
11     }
12     if (!isNumeric(period) || period < 0) {
13         period = 0;
14     }
15     if (!scheduler || typeof scheduler.schedule !== 'function') {
16         scheduler = async;
17     }
18     return new Observable(function (subscriber) {
19         subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
20         return subscriber;
21     });
22 }
23 function dispatch(state) {
24     var subscriber = state.subscriber, counter = state.counter, period = state.period;
25     subscriber.next(counter);
26     this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
27 }
28 //# sourceMappingURL=interval.js.map