Skip to content

@statesync/electron


@statesync/electron / snapshotChannel

Function: snapshotChannel() ​

ts
function snapshotChannel(topic): string;

Defined in: channels.ts:49

Returns the IPC channel name used for snapshot request/response for a given topic.

The main process registers an ipcMain.handle() listener on this channel, and the renderer invokes it via ipcRenderer.invoke() to fetch the current SnapshotEnvelope.

Parameters ​

ParameterTypeDescription
topicstringThe sync topic identifier (e.g. "user-profile").

Returns ​

string

The fully-qualified IPC channel string in the format statesync:<topic>:snapshot.

Example ​

ts
snapshotChannel('user-profile');
// => 'statesync:user-profile:snapshot'

Released under the MIT License.