Learn about the differences between watch and watchEffect hooks in the Vue.js Composition API, when to use what, and how watchEffect is similar to computed.
When I first studied the new Composition API, I was confused that there are two watch hooks: watch() and watchEffect(). From the documentation alone, it was not immediately apparent to me what’s the difference.
The watchEffect() hook’s main difference is that you don’t watch one specific reactive value but every reactive value inside its callback function. It works like the computed() hook or the computed option, but instead of returning a value, you use it to trigger side-effects.
🔴 / tecflair