MCPcopy
hub / github.com/vuejs/composition-api / customReactive

Function customReactive

src/mixin.ts:161–183  ·  view source on GitHub ↗
(target: object, seen = new Set())

Source from the content-addressed store, hash-verified

159 }
160
161 function customReactive(target: object, seen = new Set()) {
162 if (seen.has(target)) return
163 if (
164 !isPlainObject(target) ||
165 isRef(target) ||
166 isReactive(target) ||
167 isRaw(target)
168 )
169 return
170 const Vue = getVueConstructor()
171 // @ts-expect-error https://github.com/vuejs/vue/pull/12132
172 const defineReactive = Vue.util.defineReactive
173
174 Object.keys(target).forEach((k) => {
175 const val = target[k]
176 defineReactive(target, k, val)
177 if (val) {
178 seen.add(val)
179 customReactive(val, seen)
180 }
181 return
182 })
183 }
184
185 function hasReactiveArrayChild(target: object, visited = new Map()): boolean {
186 if (visited.has(target)) {

Callers 1

initSetupFunction · 0.85

Calls 5

isPlainObjectFunction · 0.90
isRefFunction · 0.90
isReactiveFunction · 0.90
isRawFunction · 0.90
getVueConstructorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…