malaman/js-image-zoom

question on $watch and $store

srconklin opened this issue · 0 comments

How do you do the equivalent of what one did in Spruce for a watcher.
Spruce.watch('imodal.modal', value => { console.log(value); }

I tried to use $watch in a store and it threw an error:
Alpine.store('counter', { count: 0, init() { this.count = 5; this.$watch('count', this.countWatcher); }, countWatcher(value) { console.log(value); } });