Home / Function/ initProvide() — vue Function Reference

initProvide() — vue Function Reference

Architecture documentation for the initProvide() function in inject.ts from the vue codebase.

Function typescript CoreInstance VDOM calls 1 called by 1

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

src/core/instance/inject.ts lines 6–28

export function initProvide(vm: Component) {
  const provideOption = vm.$options.provide
  if (provideOption) {
    const provided = isFunction(provideOption)
      ? provideOption.call(vm)
      : provideOption
    if (!isObject(provided)) {
      return
    }
    const source = resolveProvided(vm)
    // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
    // iterate the keys ourselves.
    const keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided)
    for (let i = 0; i < keys.length; i++) {
      const key = keys[i]
      Object.defineProperty(
        source,
        key,
        Object.getOwnPropertyDescriptor(provided, key)!
      )
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does initProvide() do?
initProvide() is a function in the vue codebase.
What does initProvide() call?
initProvide() calls 1 function(s): resolveProvided.
What calls initProvide()?
initProvide() is called by 1 function(s): initMixin.

Analyze Your Own Codebase

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

Try Supermodel Free