Skip to content
On this page

resolveUnref

Category
Last Changed
2 weeks ago
Related

Get the value of value/ref/getter.

Usage

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

/**
 * Normalize value/ref/getter to `ref` or `computed`.
 */
export declare function resolveUnref<T>(r: MaybeComputedRef<T>): T
/**
 * Normalize value/ref/getter to `ref` or `computed`.
 */
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)
resolveUnref has loaded