SyncOptions
Import
import { SyncOptions } from "@hyper-fetch/db"
Source
Package
Preview
type SyncOptions<Row,KeyField,Listener,Type,Mapped> = {
byKey?: (key: NonNullable<Row[KeyField]>) => ListenerPatch;
incomplete?: refetch;
key?: (message: SyncMessage<Listener>) => NonNullable<Row[KeyField]>;
resumes?: boolean;
row?: (message: SyncMessage<Listener>) => Mapped;
type: Type;
where?: { [ Field in keyof Row & string]?: { eq: (value: Row[Field]) => ListenerPatch } };
}
Structure
SyncOptions
| Name | Type | Description |
|---|---|---|
| incomplete | | Loads the row by key when an
|
| resumes | | The adapter resumes the subscription from its last event id after a reconnect, so nothing is missed |
| type | | |
| where | | Maps a query's filters to listener params or a subscription payload |
| byKey | | Listener params that keep one row read by key live, such as a channel per record |
| key | | Reads the key of a deleted row from a message |
| row | | Reshapes a message into a row, or into the key and changed fields for
|
