<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`MetadataCache`](MetadataCache) › [on('changed')](MetadataCache/on('changed').md) ## MetadataCache.on('changed') method Called when a file has been indexed, and its (updated) cache is now available. Note: This is not called when a file is renamed for performance reasons. You must hook the vault rename event for those. **Signature:** ```typescript on(name: 'changed', callback: (file: TFile, data: string, cache: CachedMetadata) => any, ctx?: any): EventRef; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | <code>name</code> | <code>'changed'</code> | | | <code>callback</code> | <code>(file: </code>[`TFile`](TFile)<code>, data: string, cache: </code>[`CachedMetadata`](CachedMetadata)<code>) =&gt; any</code> | | | <code>ctx</code> | <code>any</code> | _(Optional)_ | **Returns:** [`EventRef`](EventRef)