import { Observable } from '../Observable'; import { ReplaySubject } from '../ReplaySubject'; import { Scheduler } from '../Scheduler'; import { multicast } from './multicast'; import { ConnectableObservable } from '../observable/ConnectableObservable'; /** * @param bufferSize * @param windowTime * @param scheduler * @return {ConnectableObservable} * @method publishReplay * @owner Observable */ export function publishReplay(this: Observable, bufferSize: number = Number.POSITIVE_INFINITY, windowTime: number = Number.POSITIVE_INFINITY, scheduler?: Scheduler): ConnectableObservable { return multicast.call(this, new ReplaySubject(bufferSize, windowTime, scheduler)); }