wishthis/node_modules/rxjs/dist/cjs/internal/operators/connect.js
2022-04-07 09:06:43 +02:00

21 lines
No EOL
828 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.connect = void 0;
var Subject_1 = require("../Subject");
var from_1 = require("../observable/from");
var lift_1 = require("../util/lift");
var fromSubscribable_1 = require("../observable/fromSubscribable");
var DEFAULT_CONFIG = {
connector: function () { return new Subject_1.Subject(); },
};
function connect(selector, config) {
if (config === void 0) { config = DEFAULT_CONFIG; }
var connector = config.connector;
return lift_1.operate(function (source, subscriber) {
var subject = connector();
from_1.from(selector(fromSubscribable_1.fromSubscribable(subject))).subscribe(subscriber);
subscriber.add(source.subscribe(subject));
});
}
exports.connect = connect;
//# sourceMappingURL=connect.js.map