1 | import { FetchResult, NextLink, Operation } from '../core';
|
2 | import { Observable } from '../../utilities';
|
3 | export type BatchHandler = (operations: Operation[], forward?: (NextLink | undefined)[]) => Observable<FetchResult[]> | null;
|
4 | export interface BatchableRequest {
|
5 | operation: Operation;
|
6 | forward?: NextLink;
|
7 | }
|
8 | export declare class OperationBatcher {
|
9 | private batchesByKey;
|
10 | private scheduledBatchTimerByKey;
|
11 | private batchDebounce?;
|
12 | private batchInterval?;
|
13 | private batchMax;
|
14 | private batchHandler;
|
15 | private batchKey;
|
16 | constructor({ batchDebounce, batchInterval, batchMax, batchHandler, batchKey, }: {
|
17 | batchDebounce?: boolean;
|
18 | batchInterval?: number;
|
19 | batchMax?: number;
|
20 | batchHandler: BatchHandler;
|
21 | batchKey?: (operation: Operation) => string;
|
22 | });
|
23 | enqueueRequest(request: BatchableRequest): Observable<FetchResult>;
|
24 | consumeQueue(key?: string): (Observable<FetchResult> | undefined)[] | undefined;
|
25 | private scheduleQueueConsumption;
|
26 | }
|
27 | //# sourceMappingURL=batching.d.ts.map |
\ | No newline at end of file |