Skip to content
Discussion options

You must be logged in to vote

Like @danddanddand is saying you can use Alpine.effect instead of a manual watcher:

Alpine.effect(() => {
  Object.keys(defaultSettings).forEach((key, index) => {
        let value = Alpine.store('settings')[key]

        setQueryStringParameter(key, encodeURIComponent(JSON.stringify(value)));
  });
})

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ryangjchandler
Comment options

Answer selected by chapmanjacobd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants