wip: adjust computed ref type
This commit is contained in:
@@ -6,9 +6,11 @@ import { reactive } from './reactive'
|
||||
export const knownValues = new WeakSet()
|
||||
|
||||
export interface Ref<T> {
|
||||
value: T extends Ref<infer V> ? Ref<V> : UnwrapRef<T>
|
||||
value: UnwrapNestedRefs<T>
|
||||
}
|
||||
|
||||
export type UnwrapNestedRefs<T> = T extends Ref<infer V> ? Ref<V> : UnwrapRef<T>
|
||||
|
||||
const convert = (val: any): any => (isObject(val) ? reactive(val) : val)
|
||||
|
||||
export function ref<T>(raw: T): Ref<T> {
|
||||
|
||||
Reference in New Issue
Block a user