source: trip-planner-front/node_modules/rxjs/internal/operators/multicast.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var ConnectableObservable_1 = require("../observable/ConnectableObservable");
4function multicast(subjectOrSubjectFactory, selector) {
5 return function multicastOperatorFunction(source) {
6 var subjectFactory;
7 if (typeof subjectOrSubjectFactory === 'function') {
8 subjectFactory = subjectOrSubjectFactory;
9 }
10 else {
11 subjectFactory = function subjectFactory() {
12 return subjectOrSubjectFactory;
13 };
14 }
15 if (typeof selector === 'function') {
16 return source.lift(new MulticastOperator(subjectFactory, selector));
17 }
18 var connectable = Object.create(source, ConnectableObservable_1.connectableObservableDescriptor);
19 connectable.source = source;
20 connectable.subjectFactory = subjectFactory;
21 return connectable;
22 };
23}
24exports.multicast = multicast;
25var MulticastOperator = (function () {
26 function MulticastOperator(subjectFactory, selector) {
27 this.subjectFactory = subjectFactory;
28 this.selector = selector;
29 }
30 MulticastOperator.prototype.call = function (subscriber, source) {
31 var selector = this.selector;
32 var subject = this.subjectFactory();
33 var subscription = selector(subject).subscribe(subscriber);
34 subscription.add(source.subscribe(subject));
35 return subscription;
36 };
37 return MulticastOperator;
38}());
39exports.MulticastOperator = MulticastOperator;
40//# sourceMappingURL=multicast.js.map
Note: See TracBrowser for help on using the repository browser.