Skip to content

Workspace.on('resize') method

Workspace › on(‘resize’)

Official

Triggered when a WorkspaceItem is resized or the workspace layout has changed.

Signature:

on(name: "resize", callback: () => unknown, ctx?: unknown): EventRef

Parameters:

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

Returns: EventRefThe event reference.

Example:

app.workspace.on('resize', () => {
console.log('resize');
});