ElectronIpcRenderer.once method
ElectronIpcRenderer › 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: IpcRendererEvent, ...args: unknown[]) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| channel | string | The IPC channel name. |
| listener | (event: IpcRendererEvent, ...args: unknown[]) => void | Callback invoked when a message is received. |
Returns: this — This IpcRenderer instance.