Skip to content

ElectronIpcRenderer.sendSync method

ElectronIpcRenderer › sendSync

Unofficial

Sends a message to the main process via channel and expects a result synchronously.

The main process handles it by listening for channel with the ipcMain module and replies by setting event.returnValue. Sending a synchronous message blocks the whole renderer process until the reply is received, so use this only as a last resort.

Signature:

sendSync(channel: string, args?: unknown[]): unknown

Parameters:

Parameter Type Description
channel string The IPC channel name.
args? unknown[] Arguments to send.

Returns: unknownThe value sent back by the ipcMain handler.