2022-06-08 10:36:39 +00:00
|
|
|
import { ReplaySubject } from '../ReplaySubject';
|
|
|
|
import { share } from './share';
|
|
|
|
export function shareReplay(configOrBufferSize, windowTime, scheduler) {
|
|
|
|
let bufferSize;
|
|
|
|
let refCount = false;
|
|
|
|
if (configOrBufferSize && typeof configOrBufferSize === 'object') {
|
|
|
|
({ bufferSize = Infinity, windowTime = Infinity, refCount = false, scheduler } = configOrBufferSize);
|
|
|
|
}
|
|
|
|
else {
|
2022-07-15 07:58:48 +00:00
|
|
|
bufferSize = (configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity);
|
2022-06-08 10:36:39 +00:00
|
|
|
}
|
|
|
|
return share({
|
|
|
|
connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),
|
|
|
|
resetOnError: true,
|
|
|
|
resetOnComplete: false,
|
|
|
|
resetOnRefCountZero: refCount,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//# sourceMappingURL=shareReplay.js.map
|