https://stackoverflow.com/a/63800832/1497720
Typical watch syntax is watch(<variable>, <function to handle>)
but in this answer: https://stackoverflow.com/a/63800832/1497720
we have
watch(() => route.name, () => {
console.debug(`MyCoolComponent - watch route.name changed to ${route.name}`);
// Do something here...
// Optionally you can set immediate: true config for the watcher to run on init
//}, { immediate: true });
});
Can someone explain what's the syntax means?