feat(reactivity): expose unref and shallowRef
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { expectType } from 'tsd'
|
||||
import { Ref, ref } from './index'
|
||||
import { isRef } from '@vue/reactivity'
|
||||
import { Ref, ref, isRef, unref } from './index'
|
||||
|
||||
function foo(arg: number | Ref<number>) {
|
||||
// ref coercing
|
||||
@@ -11,6 +10,9 @@ function foo(arg: number | Ref<number>) {
|
||||
if (isRef(arg)) {
|
||||
expectType<Ref<number>>(arg)
|
||||
}
|
||||
|
||||
// ref unwrapping
|
||||
expectType<number>(unref(arg))
|
||||
}
|
||||
|
||||
foo(1)
|
||||
|
||||
Reference in New Issue
Block a user