Home / Function/ resolveProvided() — vue Function Reference

resolveProvided() — vue Function Reference

Architecture documentation for the resolveProvided() function in apiInject.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  d67548f7_f00b_fa56_7339_319189a3fea6["resolveProvided()"]
  8a6e2a59_62cd_9de3_1e9c_dae6bffeba9c["initProvide()"]
  8a6e2a59_62cd_9de3_1e9c_dae6bffeba9c -->|calls| d67548f7_f00b_fa56_7339_319189a3fea6
  d6f9c4a5_f357_bc13_42fe_6cb60cb676ba["provide()"]
  d6f9c4a5_f357_bc13_42fe_6cb60cb676ba -->|calls| d67548f7_f00b_fa56_7339_319189a3fea6
  style d67548f7_f00b_fa56_7339_319189a3fea6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/apiInject.ts lines 18–31

export function resolveProvided(vm: Component): Record<string, any> {
  // by default an instance inherits its parent's provides object
  // but when it needs to provide values of its own, it creates its
  // own provides object using parent provides object as prototype.
  // this way in `inject` we can simply look up injections from direct
  // parent and let the prototype chain do the work.
  const existing = vm._provided
  const parentProvides = vm.$parent && vm.$parent._provided
  if (parentProvides === existing) {
    return (vm._provided = Object.create(parentProvides))
  } else {
    return existing
  }
}

Domain

Subdomains

Frequently Asked Questions

What does resolveProvided() do?
resolveProvided() is a function in the vue codebase.
What calls resolveProvided()?
resolveProvided() is called by 2 function(s): initProvide, provide.

Analyze Your Own Codebase

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

Try Supermodel Free