UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

23 lines 975 B
import { ReplaySubject } from '../ReplaySubject'; import { share } from './share'; export function shareReplay(configOrBufferSize, windowTime, scheduler) { var _a, _b; let bufferSize; let 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({ connector: () => new ReplaySubject(bufferSize, windowTime, scheduler), resetOnError: true, resetOnComplete: false, resetOnRefCountZero: refCount }); } //# sourceMappingURL=shareReplay.js.map