DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/type-aliases/DeltaEvent.md
DeltaEvent
ts
type DeltaEvent<TRow, TKey> =
| {
key: TKey;
metadata?: Record<string, unknown>;
type: "enter";
value: TRow;
}
| {
key: TKey;
metadata?: Record<string, unknown>;
type: "exit";
value: TRow;
}
| {
key: TKey;
metadata?: Record<string, unknown>;
previousValue: TRow;
type: "update";
value: TRow;
};Defined in: packages/db/src/query/effect.ts:54
Delta event emitted when a row enters, exits, or updates within a query result
Type Parameters#
TRow#
TRow extends object = Record<string, unknown>
TKey#
TKey extends string | number = string | number
Type Declaration#
ts
{
key: TKey;
metadata?: Record<string, unknown>;
type: "enter";
value: TRow;
}key#
ts
key: TKey;metadata?#
ts
optional metadata: Record<string, unknown>;type#
ts
type: "enter";value#
ts
value: TRow;Current value for the entering row
ts
{
key: TKey;
metadata?: Record<string, unknown>;
type: "exit";
value: TRow;
}key#
ts
key: TKey;metadata?#
ts
optional metadata: Record<string, unknown>;type#
ts
type: "exit";value#
ts
value: TRow;Current value for the exiting row
ts
{
key: TKey;
metadata?: Record<string, unknown>;
previousValue: TRow;
type: "update";
value: TRow;
}key#
ts
key: TKey;metadata?#
ts
optional metadata: Record<string, unknown>;previousValue#
ts
previousValue: TRow;Previous value before the batch
type#
ts
type: "update";value#
ts
value: TRow;Current value after the update