multicast.js 585 B

12345678910111213
  1. import { ConnectableObservable } from '../observable/ConnectableObservable';
  2. import { isFunction } from '../util/isFunction';
  3. import { connect } from './connect';
  4. export function multicast(subjectOrSubjectFactory, selector) {
  5. const subjectFactory = isFunction(subjectOrSubjectFactory) ? subjectOrSubjectFactory : () => subjectOrSubjectFactory;
  6. if (isFunction(selector)) {
  7. return connect(selector, {
  8. connector: subjectFactory,
  9. });
  10. }
  11. return (source) => new ConnectableObservable(source, subjectFactory);
  12. }
  13. //# sourceMappingURL=multicast.js.map