Skip to content
Discussion options

You must be logged in to vote

When you use $watch you're telling Alpine to monitor a property long term (open in your example) and fire a callback (console.log()) when that property changes. x-init is the perfect place for that since you only want it to register the watcher one time.

Maybe a good way to think about it is you're "registering" a long-running watcher?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Chandler-Zhu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants