]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types(reactivity): simplify UnwrapNestedRefs (#4194)
authorPick <chenyi.c137@bytedance.com>
Wed, 28 Jul 2021 15:15:08 +0000 (23:15 +0800)
committerGitHub <noreply@github.com>
Wed, 28 Jul 2021 15:15:08 +0000 (11:15 -0400)
packages/reactivity/src/reactive.ts
packages/reactivity/src/ref.ts

index 148a583c06f4a2518e6333b39f7a6cf992ccc7ab..2bcce11e716f9e729c9c47f2c28f612541b8337e 100644 (file)
@@ -11,7 +11,7 @@ import {
   shallowCollectionHandlers,
   shallowReadonlyCollectionHandlers
 } from './collectionHandlers'
-import { UnwrapRef, Ref } from './ref'
+import { UnwrapRefSimple, Ref } from './ref'
 
 export const enum ReactiveFlags {
   SKIP = '__v_skip',
@@ -60,7 +60,7 @@ function getTargetType(value: Target) {
 }
 
 // only unwrap nested ref
-export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRef<T>
+export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>
 
 /**
  * Creates a reactive copy of the original object.
index 9bdf76b4e585a1bd81cb01193a5b231cad090f2d..fc2db5f8cdf816011d0eb250f4b73b12a1e8c96d 100644 (file)
@@ -264,7 +264,7 @@ export type UnwrapRef<T> = T extends Ref<infer V>
   ? UnwrapRefSimple<V>
   : UnwrapRefSimple<T>
 
-type UnwrapRefSimple<T> = T extends
+export type UnwrapRefSimple<T> = T extends
   | Function
   | CollectionTypes
   | BaseTypes