types: improve type 'Ref' (#105)

This commit is contained in:
扩散性百万甜面包 2019-10-05 22:10:37 +08:00 committed by Evan You
parent 9d6783053c
commit 5c1e42f754

View File

@ -1,16 +1,13 @@
import { effect, ReactiveEffect, activeReactiveEffectStack } from './effect'
import { UnwrapNestedRefs } from './ref'
import { Ref, UnwrapNestedRefs } from './ref'
import { isFunction } from '@vue/shared'
export interface ComputedRef<T> {
_isRef: true
export interface ComputedRef<T> extends Ref<T> {
readonly value: UnwrapNestedRefs<T>
readonly effect: ReactiveEffect
}
export interface WritableComputedRef<T> {
_isRef: true
value: UnwrapNestedRefs<T>
export interface WritableComputedRef<T> extends Ref<T> {
readonly effect: ReactiveEffect
}