Skip to content

Commit da6c055

Browse files
authored
types(reactivity): simplify UnwrapNestedRefs (#4194)
1 parent b79e4ca commit da6c055

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/reactivity/src/reactive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
shallowCollectionHandlers,
1212
shallowReadonlyCollectionHandlers
1313
} from './collectionHandlers'
14-
import { UnwrapRef, Ref } from './ref'
14+
import { UnwrapRefSimple, Ref } from './ref'
1515

1616
export const enum ReactiveFlags {
1717
SKIP = '__v_skip',
@@ -60,7 +60,7 @@ function getTargetType(value: Target) {
6060
}
6161

6262
// only unwrap nested ref
63-
export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRef<T>
63+
export type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>
6464

6565
/**
6666
* Creates a reactive copy of the original object.

packages/reactivity/src/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export type UnwrapRef<T> = T extends Ref<infer V>
264264
? UnwrapRefSimple<V>
265265
: UnwrapRefSimple<T>
266266

267-
type UnwrapRefSimple<T> = T extends
267+
export type UnwrapRefSimple<T> = T extends
268268
| Function
269269
| CollectionTypes
270270
| BaseTypes

0 commit comments

Comments
 (0)