Open History to see the last commit
1---
2id: withFlatChangeTracking
3title: withFlatChangeTracking
4---
5
6```ts
7function withFlatChangeTracking<T>(
8 targets,
9 callback,
10 asArray): Record<string, unknown>[] | undefined;
11```
12
13Defined in: [packages/db/src/proxy.ts:911](https://github.com/TanStack/db/blob/main/packages/db/src/proxy.ts#L911)
14
15Change tracking for flat rows without proxies. A draft is a shallow copy,
16and its changes are the fields that differ from the row afterwards under
17the same equality the draft proxy uses for primitives. Returns undefined
18when any row has a nested object, a getter, a symbol key, or a class
19prototype, so the caller falls back to the proxy.
20
21## Type Parameters
22
23### T
24
25`T` *extends* `object`
26
27## Parameters
28
29### targets
30
31`T`[]
32
33### callback
34
35(`drafts`) => `void`
36
37### asArray
38
39`boolean`
40
41## Returns
42
43`Record`\<`string`, `unknown`\>[] \| `undefined`