Workspaceon(‘file-open’)

Workspace.on(‘file-open’) method

Triggered when the active file changes. The file could be in a new leaf, an existing leaf, or an embed.

Signature:

on(name: 'file-open', callback: (file: TFile | null) => any, ctx?: any): EventRef;

Parameters

ParameterTypeDescription
name’file-open’
callback(file: TFile | null) any
ctxany(Optional)

Returns:

EventRef