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

createChangeProxy.md

54 lines741 Bytes

1---
2id: createChangeProxy
3title: createChangeProxy
4---
5​
6```ts
7function createChangeProxy<T>(target, parent?): object;
8```
9​
10Defined in: [packages/db/src/proxy.ts:376](https://github.com/TanStack/db/blob/main/packages/db/src/proxy.ts#L376)
11​
12Creates a proxy that tracks changes to the target object
13​
14## Type Parameters
15​
16### T
17​
18`T` *extends* `Record`\<`string` \| `symbol`, `any`\>
19​
20## Parameters
21​
22### target
23​
24`T`
25​
26The object to proxy
27​
28### parent?
29​
30`ChangeParent`
31​
32Optional parent information
33​
34## Returns
35​
36`object`
37​
38An object containing the proxy and a function to get the changes
39​
40### getChanges()
41​
42```ts
43getChanges: () => Record<string | symbol, any>;
44```
45​
46#### Returns
47​
48`Record`\<`string` \| `symbol`, `any`\>
49​
50### proxy
51​
52```ts
53proxy: T;
54```