Home / Function/ proxyWithRefUnwrap() — vue Function Reference

proxyWithRefUnwrap() — vue Function Reference

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

Function typescript VueCore Instance calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  737b31eb_8659_a208_c047_017ebd839242["proxyWithRefUnwrap()"]
  22b44e72_ad0a_6a98_e36a_e325291fd02b["ref.ts"]
  737b31eb_8659_a208_c047_017ebd839242 -->|defined in| 22b44e72_ad0a_6a98_e36a_e325291fd02b
  febe102d_0cde_5025_1bb0_883314aa12fa["initSetup()"]
  febe102d_0cde_5025_1bb0_883314aa12fa -->|calls| 737b31eb_8659_a208_c047_017ebd839242
  77439d3b_3112_cab2_abe3_0aaab4a3b61f["createSetupContext()"]
  77439d3b_3112_cab2_abe3_0aaab4a3b61f -->|calls| 737b31eb_8659_a208_c047_017ebd839242
  e0d5e26d_6795_78df_131f_c2899a520a0d["proxyRefs()"]
  e0d5e26d_6795_78df_131f_c2899a520a0d -->|calls| 737b31eb_8659_a208_c047_017ebd839242
  f264de96_ce30_ab7e_6f2f_bd7a1a19804f["isRef()"]
  737b31eb_8659_a208_c047_017ebd839242 -->|calls| f264de96_ce30_ab7e_6f2f_bd7a1a19804f
  style 737b31eb_8659_a208_c047_017ebd839242 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