types: improve isRef typing (#578)

This commit is contained in:
Carlos Rodrigues 2020-01-06 21:15:49 +00:00 committed by Evan You
parent 2ac4b723e0
commit 985f4c91d9

View File

@ -23,6 +23,7 @@ export interface Ref<T = any> {
const convert = <T extends unknown>(val: T): T =>
isObject(val) ? reactive(val) : val
export function isRef<T>(r: Ref<T> | T): r is Ref<T>
export function isRef(r: any): r is Ref {
return r ? r._isRef === true : false
}