DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/createLiveQueryObserver.md
createLiveQueryObserver
ts
function createLiveQueryObserver<T, TKey>(collection, options): LiveQueryObserver<T, TKey>;Defined in: packages/db/src/live-query-observer.ts:1203
Internal
Create a LiveQueryObserver for a resolved live-query collection, or a disabled observer when collection is null/undefined.
This is an unstable contract shared by TanStack DB's official framework adapters. It is exported so the adapter packages can use it, but it is not a public extension point yet: its API may change in any release without a semver major.
Type Parameters#
T#
T extends object
TKey#
TKey extends string | number
Parameters#
collection#
Collection<T, TKey, any, StandardSchemaV1<unknown, unknown>, T> | null | undefined
options#
CreateLiveQueryObserverOptions = {}
Returns#
LiveQueryObserver<T, TKey>