SnapshotSyncOptions
Options of a snapshot sync,
.sync(listener, { type: "snapshot" })
: a sync whose every event carries all rows of
its filters. It serves queries like a loader, so a collection can load from a socket with no request.
import { SnapshotSyncOptions } from "@hyper-fetch/db"
Preview
type SnapshotSyncOptions<Row,Listener,Mapped,Fields,Listen> = {
listen?: Listen & SyncListen;
resumes?: boolean;
rows?: (message: SyncMessage<Listener>) => readonly Mapped[];
type: snapshot;
where?: SyncWhere<Row, Fields>;
}
Structure
| Name | Type | Description |
|---|---|---|
| listen | |
|
| resumes | | The adapter resumes the subscription from its last event id after a reconnect, so nothing is missed |
| type | | Every message carries all rows of the sync's filters, so the sync loads the collection without a loader |
| where | | Filters a query must set with
|
| rows | | Reads the complete rows from a message, for example from a wrapped list such as
|