resolveUnref
Get the value of value/ref/getter.
Usage
ts
import { resolveUnref } from '@vueuse/core'
const foo = ref('hi')
const a = resolveUnref(0) // 0
const b = resolveUnref(foo) // 'hi'
const c = resolveUnref(() => 'hi') // 'hi'
import { resolveUnref } from '@vueuse/core'
const foo = ref('hi')
const a = resolveUnref(0) // 0
const b = resolveUnref(foo) // 'hi'
const c = resolveUnref(() => 'hi') // 'hi'
Type Declarations
typescript
/**
* Get the value of value/ref/getter.
*/
export declare function resolveUnref<T>(r: MaybeComputedRef<T>): T
/**
* Get the value of value/ref/getter.
*/
export declare function resolveUnref<T>(r: MaybeComputedRef<T>): T
Source
Contributors
Anthony Fu
超杰