Skip to content

MetadataCache.on('resolve') method

MetadataCache › on(‘resolve’)

Official

Called when a file has been resolved for resolvedLinks and unresolvedLinks. This happens sometimes after a file has been indexed.

Signature:

on(name: "resolve", callback: (file: TFile) => unknown, ctx?: unknown): EventRef

Parameters:

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

Returns: EventRefThe event reference.

Example:

app.metadataCache.on('resolve', (file) => {
console.log(file);
});