Using Watchers with Vuex

Learn how Vue watchers work in detail and how we can use them with Vuex.

Vue’s reactivity is a core feature and arguably one of the most useful. Whenever we define a property, be it a prop, a data property, or a computed property, Vue’s reactivity ensures that every piece of code using this property will receive updates.

We often use Vue’s reactivity feature to promptly render a change in the template or update some subsequent property, such as a computed one. Sometimes, we need to execute more complex logic though. For these cases, Vue offers watchers.

What are watchers?

Watchers are functions we can define that Vue will execute as soon as a specified property changes. These watcher functions ...