Defined in: packages/db/src/types.ts:779
Options for subscribing to collection changes
T extends object = Record<string, unknown>
optional includeInitialState: boolean;
Defined in: packages/db/src/types.ts:783
Whether to include the current state as initial changes
optional onStatusChange: (event) => void;
Defined in: packages/db/src/types.ts:806
Internal
Listener for subscription status changes. Registered BEFORE any snapshot is requested, ensuring no status transitions are missed.
void
optional where: (row) => any;
Defined in: packages/db/src/types.ts:798
Callback function for filtering changes using a row proxy. The callback receives a proxy object that records property access, allowing you to use query builder functions like eq, gt, etc.
SingleRowRefProxy<T>
any
import { eq } from "@tanstack/db"
collection.subscribeChanges(callback, {
where: (row) => eq(row.status, "active")
})
optional whereExpression: BasicExpression<boolean>;
Defined in: packages/db/src/types.ts:800
Pre-compiled expression for filtering changes
