wishthis/node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js

20 lines
983 B
JavaScript
Raw Normal View History

2022-06-08 10:36:39 +00:00
import { ReplaySubject } from '../ReplaySubject';
import { share } from './share';
export function shareReplay(configOrBufferSize, windowTime, scheduler) {
var _a, _b, _c;
var bufferSize;
var refCount = false;
if (configOrBufferSize && typeof configOrBufferSize === 'object') {
(_a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler);
}
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: function () { return new ReplaySubject(bufferSize, windowTime, scheduler); },
resetOnError: true,
resetOnComplete: false,
resetOnRefCountZero: refCount,
});
}
//# sourceMappingURL=shareReplay.js.map