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

withCollectionConfigFactory.md

35 lines701 Bytes

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