ElectronMessagePortMain.once method
ElectronMessagePortMain › once
Unofficial
Registers a one-time listener for theclose event. Signature:
once(event: "close", listener: () => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "close" | The event name. |
| listener | () => void | Called when the port closes. |
Returns: this — This message port instance.
Unofficial
Registers a one-time listener for themessage event. Signature:
once(event: "message", listener: (messageEvent: ElectronMessageEvent) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "message" | The event name. |
| listener | (messageEvent: ElectronMessageEvent) => void | Called with the received message event. |
Returns: this — This message port instance.