types: simplify ref type

This commit is contained in:
Evan You 2019-08-18 22:48:46 -04:00
parent 3facfa5a55
commit 6a22ad2fb2

View File

@ -9,7 +9,7 @@ export interface Ref<T> {
value: UnwrapNestedRefs<T> value: UnwrapNestedRefs<T>
} }
export type UnwrapNestedRefs<T> = T extends Ref<infer V> ? Ref<V> : UnwrapRef<T> export type UnwrapNestedRefs<T> = T extends Ref<any> ? T : UnwrapRef<T>
const convert = (val: any): any => (isObject(val) ? reactive(val) : val) const convert = (val: any): any => (isObject(val) ? reactive(val) : val)