MCPcopy
hub / github.com/vuejs/core / GetterRefImpl

Class GetterRefImpl

packages/reactivity/src/ref.ts:430–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430class GetterRefImpl<T> {
431 public readonly [ReactiveFlags.IS_REF] = true
432 public readonly [ReactiveFlags.IS_READONLY] = true
433 public _value: T = undefined!
434
435 constructor(private readonly _getter: () => T) {}
436 get value() {
437 return (this._value = this._getter())
438 }
439}
440
441export type ToRef<T> = IfAny<T, Ref<T>, [T] extends [Ref] ? T : Ref<T>>
442

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected