ElectronIpcMain.once method
ElectronIpcMain › once
Unofficial
Adds a one-timelistener function for the event, invoked only the next time a message is sent to channel, after which it is removed. Signature:
once(channel: string, listener: (event: ElectronIpcMainEvent, ...args: unknown[]) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | string | The IPC channel name. |
| listener | (event: ElectronIpcMainEvent, ...args: unknown[]) => void | Callback invoked when a message is received. |
Returns: this — This IpcMain instance.