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

withchangetracking.md

41 lines773 Bytes

1---
2id: withChangeTracking
3title: withChangeTracking
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8# Function: withChangeTracking()
9​
10```ts
11function withChangeTracking<T>(target, callback): Record<string | symbol, unknown>
12```
13​
14Defined in: [packages/db/src/proxy.ts:986](https://github.com/TanStack/db/blob/main/packages/db/src/proxy.ts#L986)
15​
16Creates a proxy for an object, passes it to a callback function,
17and returns the changes made by the callback
18​
19## Type Parameters
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