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

withChangeTracking.md

39 lines668 Bytes

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