8000 typos in code (#358) · vuejs/rfcs@ce47557 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce47557

Browse files
authored
typos in code (#358)
1 parent 0574e70 commit ce47557

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

active-rfcs/0041-reactivity-effect-scope.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const scope = effectScope()
1717
scope.run(() => {
1818
const doubled = computed(() => counter.value * 2)
1919

20-
watch(doubled, () => console.log(double.value))
20+
watch(doubled, () => console.log(doubled.value))
2121

22-
watchEffect(() => console.log('Count: ', double.value))
22+
watchEffect(() => console.log('Count: ', doubled.value))
2323
})
2424

2525
// to dispose all effects in the scope
@@ -47,7 +47,7 @@ const stopWatch1 = watchEffect(() => {
4747
disposables.push(stopWatch1)
4848

4949
const stopWatch2 = watch(doubled, () => {
50-
console.log(double.value)
50+
console.log(doubled.value)
5151
})
5252

5353
disposables.push(stopWatch2)
@@ -96,9 +96,9 @@ A scope can run a function and will capture all effects created during the funct
9696
scope.run(() => {
9797
const doubled = computed(() => counter.value * 2)
9898

99-
watch(doubled, () => console.log(double.value))
99+
watch(doubled, () => console.log(doubled.value))
100100

101-
watchEffect(() => console.log('Count: ', double.value))
101+
watchEffect(() => console.log('Count: ', doubled.value))
102102
})
103103

104104
// the same scope can run multiple times
@@ -133,10 +133,10 @@ scope.run(() => {
133133

134134
// not need to get the stop handler, it will be collected by the outer scope
135135
effectScope().run(() => {
136-
watch(doubled, () => console.log(double.value))
136+
watch(doubled, () => console.log(doubled.value))
137137
})
138138

139-
watchEffect(() => console.log('Count: ', double.value))
139+
watchEffect(() => console.log('Count: ', doubled.value))
140140
})
141141

142142
// dispose all effects, including those in the nested scopes
@@ -150,7 +150,7 @@ scope.stop()
150150
This also makes usages like ["lazy initialization"](https://github.com/vuejs/vue-next/issues/1532) possible.
151151

152152
```ts
153-
let childScope
153+
let nestedScope
154154

155155
const parentScope = effectScope()
156156

@@ -159,15 +159,15 @@ parentScope.run(() => {
159159

160160
// with the detected flag,
161161
// the scope will not be collected and disposed by the outer scope
162-
childScope = effectScope(true /* detached */)
163-
childScope.run(() => {
164-
watch(doubled, () => console.log(double.value))
162+
nestedScope = effectScope(true /* detached */)
163+
nestedScope.run(() => {
164+
watch(doubled, () => console.log(doubled.value))
165165
})
166166

167-
watchEffect(() => console.log('Count: ', double.value))
167+
watchEffect(() => console.log('Count: ', doubled.value))
168168
})
169169

170-
// disposes all effects, but not `childScope`
170+
// disposes all effects, but not `nestedScope`
171171
parentScope.stop()
172172

173173
// stop the nested scope only when appropriate

0 commit comments

Comments
 (0)
0