types(reactivity): simplify UnwrapNestedRefs (#4194)
This commit is contained in:
parent
b79e4ca717
commit
da6c055b19
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user