Home Manual Reference Source Test Repository

es6/operator/shareReplay.js

import { multicast } from './multicast';
import { ReplaySubject } from '../ReplaySubject';
/**
 * @method shareReplay
 * @owner Observable
 */
export function shareReplay(bufferSize, windowTime, scheduler) {
    let subject;
    const connectable = multicast.call(this, function shareReplaySubjectFactory() {
        if (this._isComplete) {
            return subject;
        }
        else {
            return (subject = new ReplaySubject(bufferSize, windowTime, scheduler));
        }
    });
    return connectable.refCount();
}
;
//# sourceMappingURL=shareReplay.js.map