Open History to see the last commit
1---
2id: withCollectionSyncConfigCleanup
3title: withCollectionSyncConfigCleanup
4---
5
6```ts
7function withCollectionSyncConfigCleanup<TSync>(sync, cleanup): TSync;
8```
9
10Defined in: [packages/db/src/collection/index.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L95)
11
12**`Internal`**
13
14Registers work owned before an adapter sync starts.
15
16## Type Parameters
17
18### TSync
19
20`TSync` *extends* `object`
21
22## Parameters
23
24### sync
25
26`TSync`
27
28### cleanup
29
30() => `void`
31
32## Returns
33
34`TSync`