@statesync/electron / CreateElectronRevisionSyncOptions
Interface: CreateElectronRevisionSyncOptions<T>
Defined in: sync.ts:28
Configuration options for createElectronRevisionSync.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The application-specific snapshot data type. |
Properties
applier
applier: SnapshotApplier<T>;Defined in: sync.ts:45
Callback invoked to apply a new snapshot to the application state.
See
SnapshotApplier from @statesync/core.
bridge
bridge: ElectronStateSyncBridge;Defined in: sync.ts:38
The bridge object exposed via contextBridge.exposeInMainWorld() in the preload script.
Typically accessed as (window as any).statesync in the renderer. Created by createElectronBridge.
invalidationChannel?
optional invalidationChannel: string;Defined in: sync.ts:52
Override the default IPC channel for invalidation events.
Defaults to statesync:<topic>:invalidated.
logger?
optional logger: Logger;Defined in: sync.ts:75
Optional logger for debug, warn, and error messages.
See
RevisionSyncOptions.logger
onError()?
optional onError: (ctx) => void;Defined in: sync.ts:82
Optional error callback invoked when any phase of the sync loop fails.
Parameters
| Parameter | Type |
|---|---|
ctx | SyncErrorContext |
Returns
void
See
RevisionSyncOptions.onError
shouldRefresh()?
optional shouldRefresh: (event) => boolean;Defined in: sync.ts:68
Optional predicate to filter invalidation events before triggering a refresh.
If provided, only events for which this returns true will cause a snapshot fetch.
Parameters
| Parameter | Type |
|---|---|
event | InvalidationEvent |
Returns
boolean
See
RevisionSyncOptions.shouldRefresh
snapshotChannel?
optional snapshotChannel: string;Defined in: sync.ts:59
Override the default IPC channel for snapshot requests.
Defaults to statesync:<topic>:snapshot.
throttling?
optional throttling: InvalidationThrottlingOptions;Defined in: sync.ts:90
Optional throttling/debouncing configuration to control how frequently invalidation events trigger snapshot refreshes.
See
InvalidationThrottlingOptions from @statesync/core.
topic
topic: string;Defined in: sync.ts:30
The sync topic identifier (e.g. "user-profile"). Must be a non-empty string.
