publishReplay.js 686 B

123456789101112
  1. /** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */
  2. import { ReplaySubject } from '../ReplaySubject';
  3. import { multicast } from './multicast';
  4. export function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
  5. if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
  6. scheduler = selectorOrScheduler;
  7. }
  8. var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
  9. var subject = new ReplaySubject(bufferSize, windowTime, scheduler);
  10. return function (source) { return multicast(function () { return subject; }, selector)(source); };
  11. }
  12. //# sourceMappingURL=publishReplay.js.map