Open History to see the last commit
1---
2id: withCollectionConfigFactory
3title: withCollectionConfigFactory
4---
5
6# Function: withCollectionConfigFactory()
7
8```ts
9function withCollectionConfigFactory<TConfig>(config, factory): CollectionConfigWithFactory<TConfig>;
10```
11
12Defined in: [packages/db/src/client.ts:81](https://github.com/TanStack/db/blob/main/packages/db/src/client.ts#L81)
13
14Adds a fresh-config materializer to an adapter options object.
15
16Adapter option creators should use this so a module-scoped descriptor can be
17materialized safely by more than one DbClient.
18
19## Type Parameters
20
21### TConfig
22
23`TConfig` *extends* `AnyCollectionConfig`
24
25## Parameters
26
27### config
28
29`TConfig`
30
31### factory
32
33(`client`) => `TConfig`
34
35## Returns
36
37`CollectionConfigWithFactory`\<`TConfig`\>