Defined in: packages/db/src/query/effect.ts:112
Effect configuration
TRow extends object = Record<string, unknown>
TKey extends string | number = string | number
optional id: string;Defined in: packages/db/src/query/effect.ts:117
Optional ID for debugging/tracing
optional onBatch: EffectBatchHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:132
Called once per graph run with all delta events from that batch
optional onEnter: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:123
Called once for each row entering the query result
optional onError: (error, event) => void;Defined in: packages/db/src/query/effect.ts:135
Error handler for exceptions thrown by effect callbacks
Error
DeltaEvent<TRow, TKey>
void
optional onExit: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:129
Called once for each row exiting the query result
optional onHealthChange: (health) => void;Defined in: packages/db/src/query/effect.ts:153
Called after the effect's initial-query readiness whenever its health tree changes. A sync problem after initial-query readiness does not dispose the effect; read the health tree to decide what to do.
void
optional onSourceError: (error) => void;Defined in: packages/db/src/query/effect.ts:146
Called when a source crashes, fails its first load before the effect's initial-query readiness, or is cleaned up while the effect reads it, and when a subset load the effect requests from a source, or its release, fails, before or after that readiness. A cascade cleanup that ends the effect does not call it. The effect is automatically disposed after this callback fires. If not provided, the error is logged to console.error.
Error
void
optional onUpdate: EffectEventHandler<TRow, TKey>;Defined in: packages/db/src/query/effect.ts:126
Called once for each row updating within the query result
query: EffectQueryInput<any>;Defined in: packages/db/src/query/effect.ts:120
Query to watch for deltas
optional skipInitial: boolean;Defined in: packages/db/src/query/effect.ts:160
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.