@tanstack/db
Version:
A reactive client store for building super fast apps on sync
23 lines (22 loc) • 701 B
text/typescript
export declare const cleanupNow: () => number;
/**
* Batches many GC registrations behind a single shared timeout.
*/
export declare class CleanupQueue {
private static instance;
private tasks;
private timeoutId;
private microtaskScheduled;
private constructor();
static getInstance(): CleanupQueue;
/**
* Queues a cleanup task and defers timeout selection to a microtask so
* multiple synchronous registrations can share one root timer.
*/
schedule(key: unknown, gcTime: number, callback: () => void): void;
cancel(key: unknown): void;
/**
* Keeps only one active timeout: whichever task is due next.
*/
private updateTimeout;
}