UNPKG

@purevue/reactivity

Version:

## 📖 Introduction

25 lines 832 B
import { Dep } from '../dep'; export type ComputedGetter<T> = (oldValue?: T) => T; export type ComputedSetter<T> = (newValue: T) => void; export interface ComputedOptions<T, S = T> { get: ComputedGetter<T>; set?: ComputedSetter<S>; } export declare class ComputedRefImpl<T = any> { getter: ComputedGetter<T>; private readonly setter; /** value 值 */ private _value; /** 数据是否为脏数据(失效) */ private _dirty; /** 本身作为依赖时,收集副作用 */ dep: Dep; /** 本身作为副作用时,被依赖收集 */ private effect; /** ref标识 */ readonly __v_isRef = true; constructor(getter: ComputedGetter<T>, setter: ComputedSetter<T> | undefined); get value(): T; set value(newValue: T); } //# sourceMappingURL=computedRefImpl.d.ts.map