Monitor component properties with $watch
The
$watch magic method in Alpine.js monitors component properties for changes and executes a callback with the new value. Use it within x-init to set up the watcher when the component initializes.