From: Pick Date: Wed, 17 Jun 2020 20:06:55 +0000 (+0800) Subject: refactor(types): simplified UnwrapRef (#1390) X-Git-Tag: v3.0.0-beta.16~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8899a90fc475cc8c5ed0dabc71b62985a9556e2c;p=thirdparty%2Fvuejs%2Fcore.git refactor(types): simplified UnwrapRef (#1390) --- diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index d22e6a0e96..285a9937df 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -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 extends ComputedRef +export type UnwrapRef = T extends Ref ? UnwrapRefSimple - : T extends Ref ? UnwrapRefSimple : UnwrapRefSimple + : UnwrapRefSimple type UnwrapRefSimple = T extends | Function