From e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sat, 28 Jun 2025 17:26:46 -0700 Subject: initial commit: scaffolding --- .../rxjs/dist/esm/internal/operators/repeatWhen.js | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js (limited to 'node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js') diff --git a/node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js b/node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js new file mode 100644 index 0000000..82ecdd9 --- /dev/null +++ b/node_modules/rxjs/dist/esm/internal/operators/repeatWhen.js @@ -0,0 +1,46 @@ +import { innerFrom } from '../observable/innerFrom'; +import { Subject } from '../Subject'; +import { operate } from '../util/lift'; +import { createOperatorSubscriber } from './OperatorSubscriber'; +export function repeatWhen(notifier) { + return operate((source, subscriber) => { + let innerSub; + let syncResub = false; + let completions$; + let isNotifierComplete = false; + let isMainComplete = false; + const checkComplete = () => isMainComplete && isNotifierComplete && (subscriber.complete(), true); + const getCompletionSubject = () => { + if (!completions$) { + completions$ = new Subject(); + innerFrom(notifier(completions$)).subscribe(createOperatorSubscriber(subscriber, () => { + if (innerSub) { + subscribeForRepeatWhen(); + } + else { + syncResub = true; + } + }, () => { + isNotifierComplete = true; + checkComplete(); + })); + } + return completions$; + }; + const subscribeForRepeatWhen = () => { + isMainComplete = false; + innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, () => { + isMainComplete = true; + !checkComplete() && getCompletionSubject().next(); + })); + if (syncResub) { + innerSub.unsubscribe(); + innerSub = null; + syncResub = false; + subscribeForRepeatWhen(); + } + }; + subscribeForRepeatWhen(); + }); +} +//# sourceMappingURL=repeatWhen.js.map \ No newline at end of file -- cgit v1.2.3