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:

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

Returns: EventRefThe event reference.

Example:

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