effectScope — group effects.
Basic:
1import { effectScope, ref, computed } from "vue"23const scope = effectScope()45scope.run(() => {6 const count = ref(0)7 const doubled = computed(() => count.value * 2)8})910scope.stop() // Dispose all effects
Nested:
1const parentScope = effectScope()2const childScope = parentScope.run(() => {3 const nestedScope = effectScope(true)4})5parentScope.stop() // Stops all
Key: effectScope for effect management.