Rocky_Mountain_Vending/.pnpm-store/v10/files/fd/cf725be63852f4d760914fa7c9e88198efcf0d4ed4293b86e55ee2bb968d1ca382718d63e5989f27d451c23e5411501c255ae0f931a3dd969a7e51433db108
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

49 lines
No EOL
2 KiB
Text

import { Observable } from '../Observable';
import { ObservableInput, OperatorFunction } from '../types';
/**
* Branch out the source Observable values as a nested Observable using a
* factory function of closing Observables to determine when to start a new
* window.
*
* <span class="informal">It's like {@link bufferWhen}, but emits a nested
* Observable instead of an array.</span>
*
* ![](windowWhen.png)
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable emits connected, non-overlapping windows.
* It emits the current window and opens a new one whenever the Observable
* produced by the specified `closingSelector` function emits an item. The first
* window is opened immediately when subscribing to the output Observable.
*
* ## Example
*
* Emit only the first two clicks events in every window of [1-5] random seconds
*
* ```ts
* import { fromEvent, windowWhen, interval, map, take, mergeAll } from 'rxjs';
*
* const clicks = fromEvent(document, 'click');
* const result = clicks.pipe(
* windowWhen(() => interval(1000 + Math.random() * 4000)),
* map(win => win.pipe(take(2))), // take at most 2 emissions from each window
* mergeAll() // flatten the Observable-of-Observables
* );
* result.subscribe(x => console.log(x));
* ```
*
* @see {@link window}
* @see {@link windowCount}
* @see {@link windowTime}
* @see {@link windowToggle}
* @see {@link bufferWhen}
*
* @param closingSelector A function that takes no arguments and returns an
* {@link ObservableInput} (that gets converted to Observable) that signals
* (on either `next` or `complete`) when to close the previous window and
* start a new one.
* @return A function that returns an Observable of windows, which in turn are
* Observables.
*/
export declare function windowWhen<T>(closingSelector: () => ObservableInput<any>): OperatorFunction<T, Observable<T>>;
//# sourceMappingURL=windowWhen.d.ts.map