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/withFlatChangeTracking.md
withFlatChangeTracking
ts
function withFlatChangeTracking<T>(
targets,
callback,
asArray): Record<string, unknown>[] | undefined;Defined in: packages/db/src/proxy.ts:911
Change tracking for flat rows without proxies. A draft is a shallow copy, and its changes are the fields that differ from the row afterwards under the same equality the draft proxy uses for primitives. Returns undefined when any row has a nested object, a getter, a symbol key, or a class prototype, so the caller falls back to the proxy.
Type Parameters#
T#
T extends object
Parameters#
targets#
T[]
callback#
(drafts) => void
asArray#
boolean
Returns#
Record<string, unknown>[] | undefined