Skip to content

ElectronIpcMain.on method

ElectronIpcMain › on

Unofficial

Listens to channel; when a new message arrives listener is called with listener(event, args...).

Signature:

on(channel: string, listener: (event: ElectronIpcMainEvent, ...args: unknown[]) => void): this

Parameters:

ParameterTypeDescription
channelstringThe IPC channel name.
listener(event: ElectronIpcMainEvent, ...args: unknown[]) => voidCallback invoked when a message is received.

Returns: thisThis IpcMain instance.