Skip to content

Commit

Permalink
types(reactivity): simplify UnwrapNestedRefs (#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Picknight authored Jul 28, 2021
1 parent b79e4ca commit da6c055
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/reactivity/src/reactive.ts
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit da6c055

Please sign in to comment.