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

Function shallowRef

src/reactivity/ref.ts:174–183  ·  view source on GitHub ↗
(raw?: unknown)

Source from the content-addressed store, hash-verified

172export function shallowRef<T>(value: T): Ref<T>
173export function shallowRef<T = any>(): Ref<T | undefined>
174export function shallowRef(raw?: unknown) {
175 if (isRef(raw)) {
176 return raw
177 }
178 const value = shallowReactive({ [RefKey]: raw })
179 return createRef({
180 get: () => value[RefKey] as any,
181 set: (v) => ((value[RefKey] as any) = v),
182 })
183}
184
185export function triggerRef(value: any) {
186 if (!isRef(value)) return

Callers 3

ref.spec.tsFile · 0.90
ref.test-d.tsxFile · 0.85

Calls 3

shallowReactiveFunction · 0.90
isRefFunction · 0.85
createRefFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…