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:

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

Returns: EventRefThe event reference.

Example:

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