# SubscribeChangesSnapshotOptions

<!-- DO NOT EDIT: this page is autogenerated from the type comments -->

Defined in: [packages/db/src/types.ts:1321](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1321)

## Extends

- `Omit`\<[`SubscribeChangesOptions`](SubscribeChangesOptions.md)\<`T`, `TKey`\>, `"includeInitialState"`\>

## Type Parameters

### T

`T` *extends* `object` = `Record`\<`string`, `unknown`\>

### TKey

`TKey` *extends* `string` \| `number` = `string` \| `number`

## Properties

### deferAcquisition?

```ts
optional deferAcquisition?: boolean;
```

Defined in: [packages/db/src/types.ts:1269](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1269)

**`Internal`**

Whether this subscription defers provider work. It keeps the Collection
alive and reads its local rows, but starts no idle source sync run and no
acquisition attempt until `subscription.resumeDeferredAcquisition()`. A
live-query Collection defers its source subscriptions until it has a
subscriber or a preload in its current sync run.

#### Inherited from

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`deferAcquisition`](SubscribeChangesOptions.md#deferacquisition)

***

### discardsRowsOnCleanup?

```ts
optional discardsRowsOnCleanup?: boolean;
```

Defined in: [packages/db/src/types.ts:1281](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1281)

**`Internal`**

The subscriber drops the rows it was sent when the Collection is cleaned
up, so cleanup retains none of them to reconcile later writes against.

#### Inherited from

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`discardsRowsOnCleanup`](SubscribeChangesOptions.md#discardsrowsoncleanup)

***

### limit?

```ts
optional limit?: number;
```

Defined in: [packages/db/src/types.ts:1326](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1326)

**`Internal`**

Optional limit to include in loadSubset for query-specific cache keys.

#### Overrides

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`limit`](SubscribeChangesOptions.md#limit)

***

### onLoadSubsetError?

```ts
optional onLoadSubsetError?: (event) => void;
```

Defined in: [packages/db/src/types.ts:1305](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1305)

**`Internal`**

Receives subset-load failures scoped to this subscription.

#### Parameters

##### event

[`SubscriptionLoadSubsetErrorEvent`](SubscriptionLoadSubsetErrorEvent.md)

#### Returns

`void`

#### Inherited from

```ts
Omit.onLoadSubsetError
```

***

### onLoadSubsetResult?

```ts
optional onLoadSubsetResult?: (result) => void;
```

Defined in: [packages/db/src/types.ts:1303](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1303)

**`Internal`**

Callback that receives the loadSubset result (Promise or true) from requestSnapshot.
Allows the caller to directly track the loading promise for isReady status.

#### Parameters

##### result

[`LoadSubsetRequestResult`](../type-aliases/LoadSubsetRequestResult.md)

#### Returns

`void`

#### Inherited from

```ts
Omit.onLoadSubsetResult
```

***

### onStatusChange?

```ts
optional onStatusChange?: (event) => void;
```

Defined in: [packages/db/src/types.ts:1287](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1287)

**`Internal`**

Listener for subscription status changes.
Registered BEFORE any snapshot is requested, ensuring no status transitions are missed.

#### Parameters

##### event

[`SubscriptionStatusChangeEvent`](SubscriptionStatusChangeEvent.md)

#### Returns

`void`

#### Inherited from

```ts
Omit.onStatusChange
```

***

### orderBy?

```ts
optional orderBy?: OrderBy;
```

Defined in: [packages/db/src/types.ts:1325](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1325)

**`Internal`**

Optional orderBy to include in loadSubset for query-specific cache keys.

#### Overrides

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`orderBy`](SubscribeChangesOptions.md#orderby)

***

### owner?

```ts
optional owner?: CollectionDependent;
```

Defined in: [packages/db/src/types.ts:1275](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1275)

**`Internal`**

The live query or Effect this subscription reads for, so
`collection.subscribers` can name it.

#### Inherited from

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`owner`](SubscribeChangesOptions.md#owner)

***

### truncateReplayPublication?

```ts
optional truncateReplayPublication?: object;
```

Defined in: [packages/db/src/types.ts:1307](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1307)

**`Internal`**

Lets a live-query graph retain its last publication during replay.

#### fail?

```ts
readonly optional fail?: (errors) => void;
```

The replay could not load every active demand again: its failures, in failure order.

##### Parameters

###### errors

`Error`[]

##### Returns

`void`

#### siblingReplays

```ts
readonly siblingReplays: () => Promise<unknown> | undefined;
```

The replays of the graph's other subscriptions to this collection that
still load. They share one barrier, so this replay waits for them.

##### Returns

`Promise`\<`unknown`\> \| `undefined`

#### start

```ts
readonly start: (retired) => void;
```

`retired`: a reload retired the sync run, and no truncate came.

##### Parameters

###### retired

`boolean`

##### Returns

`void`

#### succeed

```ts
readonly succeed: () => void;
```

##### Returns

`void`

#### Inherited from

```ts
Omit.truncateReplayPublication
```

***

### where?

```ts
optional where?: (row) => any;
```

Defined in: [packages/db/src/types.ts:1258](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1258)

Callback function for filtering changes using a row proxy.
The callback receives a proxy object that records property access,
allowing you to use query builder functions like `eq`, `gt`, etc.

#### Parameters

##### row

`SingleRowRefProxy`\<[`WithVirtualProps`](../type-aliases/WithVirtualProps.md)\<`T`, `TKey`\>, `TKey`, `true`\>

#### Returns

`any`

#### Example

```ts
import { eq } from "@tanstack/db"

collection.subscribeChanges(callback, {
  where: (row) => eq(row.status, "active")
})
```

#### Inherited from

```ts
Omit.where
```

***

### whereExpression?

```ts
optional whereExpression?: BasicExpression<boolean>;
```

Defined in: [packages/db/src/types.ts:1260](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1260)

Pre-compiled expression for filtering changes

#### Inherited from

[`SubscribeChangesOptions`](SubscribeChangesOptions.md).[`whereExpression`](SubscribeChangesOptions.md#whereexpression)
