]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(types): simplified UnwrapRef (#1390)
authorPick <picknight@foxmail.com>
Wed, 17 Jun 2020 20:06:55 +0000 (04:06 +0800)
committerGitHub <noreply@github.com>
Wed, 17 Jun 2020 20:06:55 +0000 (16:06 -0400)
packages/reactivity/src/ref.ts

index d22e6a0e9694a5bd606256e5c0ee1f2f76f79a7c..285a9937df73b2fc5855b53efa9f495912263491 100644 (file)
@@ -2,7 +2,6 @@ import { track, trigger } from './effect'
 import { TrackOpTypes, TriggerOpTypes } from './operations'
 import { isObject, hasChanged } from '@vue/shared'
 import { reactive, isProxy, toRaw } from './reactive'
-import { ComputedRef } from './computed'
 import { CollectionTypes } from './collectionHandlers'
 
 declare const RefSymbol: unique symbol
@@ -157,9 +156,9 @@ type BaseTypes = string | number | boolean
  */
 export interface RefUnwrapBailTypes {}
 
-export type UnwrapRef<T> = T extends ComputedRef<infer V>
+export type UnwrapRef<T> = T extends Ref<infer V>
   ? UnwrapRefSimple<V>
-  : T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>
+  : UnwrapRefSimple<T>
 
 type UnwrapRefSimple<T> = T extends
   | Function