Skip to content
On this page

resolveUnref

Category
Export Size
176 B
Last Changed
2 months ago
Related

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

SourceDocs

Contributors

Anthony Fu
超杰

Changelog

v8.8.0 on 7/6/2022
29fd5 - feat(resolveRef): new function (#1743)

Released under the MIT License.