UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

27 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shareReplay = void 0; var ReplaySubject_1 = require("../ReplaySubject"); var share_1 = require("./share"); function shareReplay(configOrBufferSize, windowTime, scheduler) { var _a, _b; var bufferSize; var refCount = false; if (configOrBufferSize && typeof configOrBufferSize === 'object') { bufferSize = (_a = configOrBufferSize.bufferSize) !== null && _a !== void 0 ? _a : Infinity; windowTime = (_b = configOrBufferSize.windowTime) !== null && _b !== void 0 ? _b : Infinity; refCount = !!configOrBufferSize.refCount; scheduler = configOrBufferSize.scheduler; } else { bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity; } return share_1.share({ connector: function () { return new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler); }, resetOnError: true, resetOnComplete: false, resetOnRefCountZero: refCount }); } exports.shareReplay = shareReplay; //# sourceMappingURL=shareReplay.js.map