Rocky_Mountain_Vending/.pnpm-store/v10/files/b6/bd4aaaac484f7cab583f0435cca0d0ce2144bcce569c41baf1a7dab6d7cea97607978fd0fc400892bcd013e1f36ecddb0ce6c7a9cf13f5d1f74b5612f7027f
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

37 lines
No EOL
1.4 KiB
Text

import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { arrRemove } from '../util/arrRemove';
export function bufferCount(bufferSize, startBufferEvery = null) {
startBufferEvery = startBufferEvery !== null && startBufferEvery !== void 0 ? startBufferEvery : bufferSize;
return operate((source, subscriber) => {
let buffers = [];
let count = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
let toEmit = null;
if (count++ % startBufferEvery === 0) {
buffers.push([]);
}
for (const buffer of buffers) {
buffer.push(value);
if (bufferSize <= buffer.length) {
toEmit = toEmit !== null && toEmit !== void 0 ? toEmit : [];
toEmit.push(buffer);
}
}
if (toEmit) {
for (const buffer of toEmit) {
arrRemove(buffers, buffer);
subscriber.next(buffer);
}
}
}, () => {
for (const buffer of buffers) {
subscriber.next(buffer);
}
subscriber.complete();
}, undefined, () => {
buffers = null;
}));
});
}
//# sourceMappingURL=bufferCount.js.map