Skip to content

Vault.on('modify') method

Vault › on(‘modify’)

Official

Called when a file is modified.

Signature:

on(name: "modify", callback: (file: TAbstractFile) => unknown, ctx?: unknown): EventRef

Parameters:

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

Returns: EventRefThe event reference.

Example:

app.vault.on('modify', (file) => {
console.log(file);
});