Open History to see the last commit
1---
2id: CollectionDependent
3title: CollectionDependent
4---
5
6Defined in: [packages/db/src/types.ts:1218](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1218)
7
8Something that reads a Collection, as listed by `collection.subscribers`:
9a live query, an Effect, or a direct subscription.
10
11## Properties
12
13### active
14
15```ts
16readonly active: boolean;
17```
18
19Defined in: [packages/db/src/types.ts:1227](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1227)
20
21Whether something still reads through this dependent: an Effect or a
22subscription always does; a live query does while it has a subscriber.
23`cleanup()` refuses only while an active live query or Effect remains.
24
25***
26
27### collection?
28
29```ts
30readonly optional collection: Collection<any, any, any, any, any>;
31```
32
33Defined in: [packages/db/src/types.ts:1221](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1221)
34
35A live query's Collection; a pooled live query has none.
36
37***
38
39### end()
40
41```ts
42end: () => Promise<void>;
43```
44
45Defined in: [packages/db/src/types.ts:1232](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1232)
46
47End this dependent: clean up the live query with its own dependents,
48dispose the Effect, or end the subscription.
49
50#### Returns
51
52`Promise`\<`void`\>
53
54***
55
56### kind
57
58```ts
59readonly kind: "live-query" | "effect" | "subscription";
60```
61
62Defined in: [packages/db/src/types.ts:1219](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1219)