convex
Version:
Client for the Convex Cloud
29 lines • 1.02 kB
TypeScript
import { Value } from "../values/index.js";
import { Watch } from ".";
import { QueryJournal } from "../browser/sync/protocol.js";
declare type Identifier = string;
export declare type CreateWatch = (name: string, args: Value[], journal?: QueryJournal) => Watch<Value>;
/**
* A class for observing the results of multiple queries at the same time.
*
* Any time the result of a query changes, the listeners are notified.
*/
export declare class QueriesObserver {
createWatch: CreateWatch;
private queries;
private listeners;
constructor(createWatch: CreateWatch);
setQueries(newQueries: Record<Identifier, {
name: string;
args: Value[];
}>): void;
subscribe(listener: () => void): () => void;
getCurrentQueries(): Record<Identifier, Value | undefined | Error>;
setCreateWatch(createWatch: CreateWatch): void;
destroy(): void;
private addQuery;
private removeQuery;
private notifyListeners;
}
export {};
//# sourceMappingURL=queries_observer.d.ts.map