File tree Expand file tree Collapse file tree 1 file changed +35
-6
lines changed Expand file tree Collapse file tree 1 file changed +35
-6
lines changed Original file line number Diff line number Diff line change 4
4
type DebuggerOptions ,
5
5
EffectFlags ,
6
6
type Link ,
7
- type ReactiveEffect ,
8
7
type Subscriber ,
9
8
activeSub ,
10
9
refreshComputed ,
@@ -25,7 +24,7 @@ export interface WritableComputedRef<T> extends Ref<T> {
25
24
/**
26
25
* @deprecated computed no longer uses effect
27
26
*/
28
- effect : ReactiveEffect
27
+ effect : ComputedRefImpl
29
28
}
30
29
31
30
export type ComputedGetter < T > = ( oldValue ?: T ) => T
@@ -41,18 +40,43 @@ export interface WritableComputedOptions<T> {
41
40
* the main vue package
42
41
*/
43
42
export class ComputedRefImpl < T = any > implements Subscriber {
44
- // A computed is a ref
43
+ /**
44
+ * @internal
45
+ */
45
46
_value : any = undefined
47
+ /**
48
+ * @internal
49
+ */
46
50
readonly dep = new Dep ( this )
51
+ /**
52
+ * @internal
53
+ */
47
54
readonly __v_isRef = true ;
55
+ /**
56
+ * @internal
57
+ */
48
58
readonly [ ReactiveFlags . IS_READONLY ] : boolean
49
59
// A computed is also a subscriber that tracks other deps
60
+ /**
61
+ * @internal
62
+ */
50
63
deps ?: Link = undefined
64
+ /**
65
+ * @internal
66
+ */
51
67
depsTail ?: Link = undefined
52
- // track variaous states
68
+ /**
69
+ * @internal
70
+ */
53
71
flags = EffectFlags . DIRTY
54
- // last seen global version
72
+ /**
73
+ * @internal
74
+ */
55
75
globalVersion = globalVersion - 1
76
+ /**
77
+ * @internal
78
+ */
79
+ isSSR : boolean
56
80
// for backwards compat
57
81
effect = this
58
82
@@ -63,17 +87,22 @@ export class ComputedRefImpl<T = any> implements Subscriber {
63
87
64
88
/**
65
89
* Dev only
90
+ * @internal
66
91
*/
67
92
_warnRecursive ?: boolean
68
93
69
94
constructor (
70
95
public fn : ComputedGetter < T > ,
71
96
private readonly setter : ComputedSetter < T > | undefined ,
72
- public isSSR : boolean ,
97
+ isSSR : boolean ,
73
98
) {
74
99
this . __v_isReadonly = ! setter
100
+ this . isSSR = isSSR
75
101
}
76
102
103
+ /**
104
+ * @internal
105
+ */
77
106
notify ( ) {
78
107
// avoid infinite self recursion
79
108
if ( activeSub !== this ) {
You can’t perform that action at this time.
0 commit comments