onExit([callback], remove)
Class: SwingUI.
Description:
Registers, unregisters and retrieves event handler for exit event emitted by ui.exit() method.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
Function to handle the event, |
|
|
|
boolean |
false |
Removed the callback from this event |
Returns:
If called without parameters, an array of registered callbacks is returned; otherwise this instance of SwingUI class is returned.
Type: SwingUI | Array.<function()>
Examples:
Registering exit event handler:
ui.onExit(e => {console.log(`Exiting with code: ${e.code}`);});
