Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

withChangeTracking.md

41 lines704 Bytes

1---
2id: withChangeTracking
3title: withChangeTracking
4---
5​
6# Function: withChangeTracking()
7​
8```ts
9function withChangeTracking<T>(target, callback): Record<string | symbol, unknown>;
10```
11​
12Defined in: [packages/db/src/proxy.ts:1152](https://github.com/TanStack/db/blob/main/packages/db/src/proxy.ts#L1152)
13​
14Creates a proxy for an object, passes it to a callback function,
15and returns the changes made by the callback
16​
17## Type Parameters
18​
19### T
20​
21`T` *extends* `object`
22​
23## Parameters
24​
25### target
26​
27`T`
28​
29The object to proxy
30​
31### callback
32​
33(`proxy`) => `void`
34​
35Function that receives the proxy and can make changes to it
36​
37## Returns
38​
39`Record`\<`string` \| `symbol`, `unknown`\>
40​
41The changes made to the object