@tanstack/db
Version:
A reactive client store for building super fast apps on sync
33 lines (32 loc) • 1.46 kB
text/typescript
import { Collection } from '../../collection/index.js';
import { Context, GetResult } from '../builder/types.js';
import { CollectionConfigBuilder } from './collection-config-builder.js';
import { CollectionSubscription } from '../../collection/subscription.js';
import { LazyDemandPlan } from '../compiler/joins.js';
export declare class CollectionSubscriber<TContext extends Context, TResult extends object = GetResult<TContext>> {
private sourceId;
private alias;
private collection;
private collectionConfigBuilder;
private biggest;
private lastLoadRequestKey;
private subscriptionLoadingPromises;
private sentToD2Keys;
private orderedLoadSubsetResult?;
private pendingOrderedLoadPromise;
private readonly demand;
constructor(sourceId: string, alias: string, collection: Collection, collectionConfigBuilder: CollectionConfigBuilder<TContext, TResult>);
subscribe(): CollectionSubscription;
private subscribeToChanges;
setDemand(subscription: CollectionSubscription, plan: LazyDemandPlan, keys: Set<unknown>): void;
private sendChangesToPipeline;
private subscribeToMatchingChanges;
private subscribeToOrderedChanges;
loadMoreIfNeeded(subscription: CollectionSubscription): boolean;
private sendChangesToPipelineWithTracking;
private loadNextItems;
private getWhereClause;
private getOrderByInfo;
private trackSentValues;
private ensureLoadingPromise;
}