Skip to content

Vault.on('delete') method

Vault › on(‘delete’)

Official

Called when a file is deleted.

Signature:

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

Parameters:

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

Returns: EventRefThe event reference.

Example:

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