Skip to content

Workspace.on('quit') method

Workspace › on(‘quit’)

Official

Triggered when the app is about to quit. Not guaranteed to actually run. Perform some best effort cleanup here.

Signature:

on(name: "quit", callback: (tasks: Tasks) => unknown, ctx?: unknown): EventRef

Parameters:

Parameter Type Description
name "quit" Should be 'quit'.
callback (tasks: Tasks) => unknown The callback function.
ctx? unknown The context passed as this to the callback function.

Returns: EventRefThe event reference.

Example:

app.workspace.on('quit', (tasks: Tasks) => {
console.log(tasks);
});