Home / Function/ proxyWithRefUnwrap() — vue Function Reference

proxyWithRefUnwrap() — vue Function Reference

Architecture documentation for the proxyWithRefUnwrap() function in ref.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  f813e3f0_a8fa_7690_027d_8675e5e0c8e0["proxyWithRefUnwrap()"]
  ada43310_8d32_ee2a_f18b_1e24fd4f8a1d["ref.ts"]
  f813e3f0_a8fa_7690_027d_8675e5e0c8e0 -->|defined in| ada43310_8d32_ee2a_f18b_1e24fd4f8a1d
  68e41397_5a92_5b2b_c03f_8a2d186bd3a6["initSetup()"]
  68e41397_5a92_5b2b_c03f_8a2d186bd3a6 -->|calls| f813e3f0_a8fa_7690_027d_8675e5e0c8e0
  90e994f6_eac7_d182_0e97_d5a116aca32a["createSetupContext()"]
  90e994f6_eac7_d182_0e97_d5a116aca32a -->|calls| f813e3f0_a8fa_7690_027d_8675e5e0c8e0
  8265b818_190d_33ad_9e37_5d79c36ba98e["proxyRefs()"]
  8265b818_190d_33ad_9e37_5d79c36ba98e -->|calls| f813e3f0_a8fa_7690_027d_8675e5e0c8e0
  64ef09a1_8484_35c7_6154_30d045c3ca15["isRef()"]
  f813e3f0_a8fa_7690_027d_8675e5e0c8e0 -->|calls| 64ef09a1_8484_35c7_6154_30d045c3ca15
  style f813e3f0_a8fa_7690_027d_8675e5e0c8e0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/reactivity/ref.ts lines 111–138

export function proxyWithRefUnwrap(
  target: any,
  source: Record<string, any>,
  key: string
) {
  Object.defineProperty(target, key, {
    enumerable: true,
    configurable: true,
    get: () => {
      const val = source[key]
      if (isRef(val)) {
        return val.value
      } else {
        const ob = val && val.__ob__
        if (ob) ob.dep.depend()
        return val
      }
    },
    set: value => {
      const oldValue = source[key]
      if (isRef(oldValue) && !isRef(value)) {
        oldValue.value = value
      } else {
        source[key] = value
      }
    }
  })
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does proxyWithRefUnwrap() do?
proxyWithRefUnwrap() is a function in the vue codebase, defined in src/v3/reactivity/ref.ts.
Where is proxyWithRefUnwrap() defined?
proxyWithRefUnwrap() is defined in src/v3/reactivity/ref.ts at line 111.
What does proxyWithRefUnwrap() call?
proxyWithRefUnwrap() calls 1 function(s): isRef.
What calls proxyWithRefUnwrap()?
proxyWithRefUnwrap() is called by 3 function(s): createSetupContext, initSetup, proxyRefs.

Analyze Your Own Codebase

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

Try Supermodel Free