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/bufferWhen.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js (limited to 'node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js') diff --git a/node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js b/node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js new file mode 100644 index 0000000..8e47b0d --- /dev/null +++ b/node_modules/rxjs/dist/esm/internal/operators/bufferWhen.js @@ -0,0 +1,23 @@ +import { operate } from '../util/lift'; +import { noop } from '../util/noop'; +import { createOperatorSubscriber } from './OperatorSubscriber'; +import { innerFrom } from '../observable/innerFrom'; +export function bufferWhen(closingSelector) { + return operate((source, subscriber) => { + let buffer = null; + let closingSubscriber = null; + const openBuffer = () => { + closingSubscriber === null || closingSubscriber === void 0 ? void 0 : closingSubscriber.unsubscribe(); + const b = buffer; + buffer = []; + b && subscriber.next(b); + innerFrom(closingSelector()).subscribe((closingSubscriber = createOperatorSubscriber(subscriber, openBuffer, noop))); + }; + openBuffer(); + source.subscribe(createOperatorSubscriber(subscriber, (value) => buffer === null || buffer === void 0 ? void 0 : buffer.push(value), () => { + buffer && subscriber.next(buffer); + subscriber.complete(); + }, undefined, () => (buffer = closingSubscriber = null))); + }); +} +//# sourceMappingURL=bufferWhen.js.map \ No newline at end of file -- cgit v1.2.3