Skip to content

question on $watch and $store #34

Open
@srconklin

Description

@srconklin

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); } });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions