Skip to content

Commit 5c1e42f

Browse files
himself65yyx990803
authored andcommitted
types: improve type 'Ref' (vuejs#105)
1 parent 9d67830 commit 5c1e42f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/reactivity/src/computed.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { effect, ReactiveEffect, activeReactiveEffectStack } from './effect'
2-
import { UnwrapNestedRefs } from './ref'
2+
import { Ref, UnwrapNestedRefs } from './ref'
33
import { isFunction } from '@vue/shared'
44

5-
export interface ComputedRef<T> {
6-
_isRef: true
5+
export interface ComputedRef<T> extends Ref<T> {
76
readonly value: UnwrapNestedRefs<T>
87
readonly effect: ReactiveEffect
98
}
109

11-
export interface WritableComputedRef<T> {
12-
_isRef: true
13-
value: UnwrapNestedRefs<T>
10+
export interface WritableComputedRef<T> extends Ref<T> {
1411
readonly effect: ReactiveEffect
1512
}
1613

0 commit comments

Comments
 (0)