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:

Parameter Type Description
name "layout-change" Should be 'layout-change'.
callback () => unknown The callback function.
ctx? unknown The context passed as this to the callback function.

Returns: EventRefThe event reference.

Example:

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