Skip to content

@statesync/electron


@statesync/electron / invalidationChannel

Function: invalidationChannel()

ts
function invalidationChannel(topic): string;

Defined in: channels.ts:29

Returns the IPC channel name used to broadcast invalidation events for a given topic.

The main process sends InvalidationEvent payloads on this channel via webContents.send(), and the renderer subscribes via ipcRenderer.on().

Parameters

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

Returns

string

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

Example

ts
invalidationChannel('user-profile');
// => 'statesync:user-profile:invalidated'

Released under the MIT License.