listening to changes to a store #3362
svefro
started this conversation in
3. Feature Ideas
Replies: 1 comment 2 replies
-
You need to just, at the start of the effect do JSON.stringify(Alpine.store('config')) This will deeply access all the properties so that it can listen for changes on anything. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
is it possible to listen to change events from a store in javascript?
i have a store that contains user settings like so:
i want a event whenever these change.
it does not matter witch one changes.
I want to trigger a function that compares the values in the store with saved values and show a 'unsaved changes' label.
I not run the compare function using setInterval witch is not optimal.
something like this should work:
or attaching a changed function like this:
Beta Was this translation helpful? Give feedback.
All reactions