Home / Function/ pruneCache() — vue Function Reference

pruneCache() — vue Function Reference

Architecture documentation for the pruneCache() function in keep-alive.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  b0411514_5aab_a7ba_2f4b_a2aab97320ea["pruneCache()"]
  95daccf5_70b0_580d_db27_436322c3d845["default.mounted()"]
  95daccf5_70b0_580d_db27_436322c3d845 -->|calls| b0411514_5aab_a7ba_2f4b_a2aab97320ea
  62b734d8_8f31_1f86_04dd_23e2c46f149f["pruneCacheEntry()"]
  b0411514_5aab_a7ba_2f4b_a2aab97320ea -->|calls| 62b734d8_8f31_1f86_04dd_23e2c46f149f
  style b0411514_5aab_a7ba_2f4b_a2aab97320ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/components/keep-alive.ts lines 35–55

function pruneCache(
  keepAliveInstance: {
    cache: CacheEntryMap
    keys: string[]
    _vnode: VNode
    $vnode: VNode
  },
  filter: Function
) {
  const { cache, keys, _vnode, $vnode } = keepAliveInstance
  for (const key in cache) {
    const entry = cache[key]
    if (entry) {
      const name = entry.name
      if (name && !filter(name)) {
        pruneCacheEntry(cache, key, keys, _vnode)
      }
    }
  }
  $vnode.componentOptions!.children = undefined
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does pruneCache() do?
pruneCache() is a function in the vue codebase.
What does pruneCache() call?
pruneCache() calls 1 function(s): pruneCacheEntry.
What calls pruneCache()?
pruneCache() is called by 1 function(s): default.mounted.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free