aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js')
-rw-r--r--node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js b/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js
new file mode 100644
index 0000000..e91f04e
--- /dev/null
+++ b/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js
@@ -0,0 +1,61 @@
+import { innerFrom } from '../observable/innerFrom';
+import { executeSchedule } from '../util/executeSchedule';
+import { createOperatorSubscriber } from './OperatorSubscriber';
+export function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {
+ var buffer = [];
+ var active = 0;
+ var index = 0;
+ var isComplete = false;
+ var checkComplete = function () {
+ if (isComplete && !buffer.length && !active) {
+ subscriber.complete();
+ }
+ };
+ var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };
+ var doInnerSub = function (value) {
+ expand && subscriber.next(value);
+ active++;
+ var innerComplete = false;
+ innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {
+ onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);
+ if (expand) {
+ outerNext(innerValue);
+ }
+ else {
+ subscriber.next(innerValue);
+ }
+ }, function () {
+ innerComplete = true;
+ }, undefined, function () {
+ if (innerComplete) {
+ try {
+ active--;
+ var _loop_1 = function () {
+ var bufferedValue = buffer.shift();
+ if (innerSubScheduler) {
+ executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });
+ }
+ else {
+ doInnerSub(bufferedValue);
+ }
+ };
+ while (buffer.length && active < concurrent) {
+ _loop_1();
+ }
+ checkComplete();
+ }
+ catch (err) {
+ subscriber.error(err);
+ }
+ }
+ }));
+ };
+ source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {
+ isComplete = true;
+ checkComplete();
+ }));
+ return function () {
+ additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();
+ };
+}
+//# sourceMappingURL=mergeInternals.js.map \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage