publishReplay.js 603 B

1234567891011
  1. import { ReplaySubject } from '../ReplaySubject';
  2. import { multicast } from './multicast';
  3. import { isFunction } from '../util/isFunction';
  4. export function publishReplay(bufferSize, windowTime, selectorOrScheduler, timestampProvider) {
  5. if (selectorOrScheduler && !isFunction(selectorOrScheduler)) {
  6. timestampProvider = selectorOrScheduler;
  7. }
  8. const selector = isFunction(selectorOrScheduler) ? selectorOrScheduler : undefined;
  9. return (source) => multicast(new ReplaySubject(bufferSize, windowTime, timestampProvider), selector)(source);
  10. }
  11. //# sourceMappingURL=publishReplay.js.map