Skip to content

ElectronMessagePortMain.on('close') method

ElectronMessagePortMain › on(‘close’)

Unofficial

Registers a listener for the close event, emitted when the remote end becomes disconnected.

Signature:

on(event: "close", listener: () => void): this

Parameters:

Parameter Type Description
event "close" The event name.
listener () => void Called when the port closes.

Returns: thisThis message port instance.