- 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
EffectConfig
Defined in: packages/db/src/query/effect.ts:108
Effect configuration
Type Parameters#
TRow#
TRow extends object = Record<string, unknown>
TKey#
TKey extends string | number = string | number
Properties#
id?#
optional id: string;Defined in: packages/db/src/query/effect.ts:113
Optional ID for debugging/tracing
onBatch?#
optional onBatch: EffectBatchHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:128
Called once per graph run with all delta events from that batch
onEnter?#
optional onEnter: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:119
Called once for each row entering the query result
onError()?#
optional onError: (error, event) => void;Defined in: packages/db/src/query/effect.ts:131
Error handler for exceptions thrown by effect callbacks
Parameters#
error#
Error
event#
DeltaEvent<TRow, TKey>
Returns#
void
onExit?#
optional onExit: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:125
Called once for each row exiting the query result
onSourceError()?#
optional onSourceError: (error) => void;Defined in: packages/db/src/query/effect.ts:138
Called when a source collection enters an error or cleaned-up state. The effect is automatically disposed after this callback fires. If not provided, the error is logged to console.error.
Parameters#
error#
Error
Returns#
void
onUpdate?#
optional onUpdate: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:122
Called once for each row updating within the query result
query#
query: EffectQueryInput<any>;Defined in: packages/db/src/query/effect.ts:116
Query to watch for deltas
skipInitial?#
optional skipInitial: boolean;Defined in: packages/db/src/query/effect.ts:145
Skip deltas during initial collection load. Defaults to false (process all deltas including initial sync). Set to true for effects that should only process new changes.