shareReplay.js 770 B

12345678910111213141516171819
  1. import { ReplaySubject } from '../ReplaySubject';
  2. import { share } from './share';
  3. export function shareReplay(configOrBufferSize, windowTime, scheduler) {
  4. let bufferSize;
  5. let refCount = false;
  6. if (configOrBufferSize && typeof configOrBufferSize === 'object') {
  7. ({ bufferSize = Infinity, windowTime = Infinity, refCount = false, scheduler } = configOrBufferSize);
  8. }
  9. else {
  10. bufferSize = (configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity);
  11. }
  12. return share({
  13. connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),
  14. resetOnError: true,
  15. resetOnComplete: false,
  16. resetOnRefCountZero: refCount,
  17. });
  18. }
  19. //# sourceMappingURL=shareReplay.js.map