Skip to content

Workspace.on('layout-change') method

Workspace › on(‘layout-change’)

Official

Triggered when the layout of the workspace changes.

Signature:

on(name: "layout-change", callback: () => unknown, ctx?: unknown): EventRef

Parameters:

ParameterTypeDescription
name"layout-change"Should be 'layout-change'.
callback() => unknownThe callback function.
ctx?unknownThe context passed as this to the callback function.

Returns: EventRefThe event reference.

Example:

app.workspace.on('layout-change', () => {
console.log('layout-change');
});