Vault.on('delete') method
Vault › on(‘delete’)
Official
Called when a file is deleted.Signature:
on(name: "delete", callback: (file: TAbstractFile) => unknown, ctx?: unknown): EventRefParameters:
| Parameter | Type | Description |
|---|---|---|
| name | "delete" | Should be 'delete'. |
| callback | (file: TAbstractFile) => unknown | The callback function. |
| ctx? | unknown | The context passed as this to the callback function. |
Returns: EventRef — The event reference.
Example:
app.vault.on('delete', (file) => { console.log(file);});