Reactivity API: Utils
isRef()
function isRef<T>(r: Ref<T> | unknown): r is Ref<T>let foo: unknown if (isRef(foo)) { // foo's type is narrowed to Ref<unknown> foo.value }
unref()
function unref<T>(ref: T | Ref<T>): Tfunction useFoo(x: number | Ref<number>) { const unwrapped = unref(x) // unwrapped is guaranteed to be number now }
toRef()
toRefs()
isProxy()
isReactive()
isReadonly()
Last updated