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:

ParameterTypeDescription
name"quit"Should be 'quit'.
callback(tasks: Tasks) => unknownThe callback function.
ctx?unknownThe context passed as this to the callback function.

Returns: EventRefThe event reference.

Example:

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