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

withArrayChangeTracking.md

41 lines778 Bytes

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