Problem Statement
When do you use watch() vs. watchEffect()?
Explanation
Use watch(source, callback) for precise control: compare new/old values, watch specific sources, and set options like immediate/deep. Use watchEffect() for auto-tracked side effects that rerun whenever any reactive read inside changes. It’s great for quick, dependency-free reactions.
Code Solution
SolutionRead Only
watch(() => props.id, (n, o) => fetchUser(n)) watchEffect(() => console.log(form.email))