1 import { Subscriber } from '../Subscriber';
2 import { empty } from '../observable/empty';
3 export function repeat(count = -1) {
9 return source.lift(new RepeatOperator(-1, source));
12 return source.lift(new RepeatOperator(count - 1, source));
16 class RepeatOperator {
17 constructor(count, source) {
21 call(subscriber, source) {
22 return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
25 class RepeatSubscriber extends Subscriber {
26 constructor(destination, count, source) {
32 if (!this.isStopped) {
33 const { source, count } = this;
35 return super.complete();
37 else if (count > -1) {
38 this.count = count - 1;
40 source.subscribe(this._unsubscribeAndRecycle());
44 //# sourceMappingURL=repeat.js.map