iterateCacheRefs
Official
Iterate links and embeds. If callback returns true, the iteration process will be interrupted.
Import:
import { iterateCacheRefs } from 'obsidian';Example:
iterateCacheRefs(cache, (ref) => { console.log(ref); return true;});
**Signature:**
```tsfunction iterateCacheRefs(cache: CachedMetadata, cb: (ref: ReferenceCache) => boolean | void): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
cache | CachedMetadata | The cache to iterate. |
cb | (ref: ReferenceCache) => boolean | void | The callback to call for each link or embed. |
Returns: boolean — true if callback ever returns true, false otherwise.
Example:
iterateCacheRefs(cache, (ref) => { console.log(ref); return true;});