shareReplay.js 1.1 KB

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.shareReplay = void 0;
  4. var ReplaySubject_1 = require("../ReplaySubject");
  5. var share_1 = require("./share");
  6. function shareReplay(configOrBufferSize, windowTime, scheduler) {
  7. var _a, _b, _c;
  8. var bufferSize;
  9. var refCount = false;
  10. if (configOrBufferSize && typeof configOrBufferSize === 'object') {
  11. (_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);
  12. }
  13. else {
  14. bufferSize = (configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity);
  15. }
  16. return share_1.share({
  17. connector: function () { return new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler); },
  18. resetOnError: true,
  19. resetOnComplete: false,
  20. resetOnRefCountZero: refCount,
  21. });
  22. }
  23. exports.shareReplay = shareReplay;
  24. //# sourceMappingURL=shareReplay.js.map