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

createchangeproxy.md

62 lines940 Bytes

1---
2id: createChangeProxy
3title: createChangeProxy
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8# Function: createChangeProxy()
9​
10```ts
11function createChangeProxy<T>(target, parent?): object
12```
13​
14Defined in: [packages/db/src/proxy.ts:273](https://github.com/TanStack/db/blob/main/packages/db/src/proxy.ts#L273)
15​
16Creates a proxy that tracks changes to the target object
17​
18## Type Parameters
19​
20• **T** *extends* `Record`\<`string` \| `symbol`, `any`\>
21​
22## Parameters
23​
24### target
25​
26`T`
27​
28The object to proxy
29​
30### parent?
31​
32Optional parent information
33​
34#### prop
35​
36`string` \| `symbol`
37​
38#### tracker
39​
40`ChangeTracker`\<`Record`\<`string` \| `symbol`, `unknown`\>\>
41​
42## Returns
43​
44`object`
45​
46An object containing the proxy and a function to get the changes
47​
48### getChanges()
49​
50```ts
51getChanges: () => Record<string | symbol, any>;
52```
53​
54#### Returns
55​
56`Record`\<`string` \| `symbol`, `any`\>
57​
58### proxy
59​
60```ts
61proxy: T;
62```