1 import { Observable } from '../Observable';
2 import { async } from '../scheduler/async';
3 import { isNumeric } from '../util/isNumeric';
4 export function interval(period = 0, scheduler = async) {
5 if (!isNumeric(period) || period < 0) {
8 if (!scheduler || typeof scheduler.schedule !== 'function') {
11 return new Observable(subscriber => {
12 subscriber.add(scheduler.schedule(dispatch, period, { subscriber, counter: 0, period }));
16 function dispatch(state) {
17 const { subscriber, counter, period } = state;
18 subscriber.next(counter);
19 this.schedule({ subscriber, counter: counter + 1, period }, period);
21 //# sourceMappingURL=interval.js.map