Skip to content
Discussion options

You must be logged in to vote

You need to use a standard function.
Alpine needs to bind a custom this to make magics available and in javascript is not possible to re-bind this for arrow functions.

Alpine.data('myComponent', function() {
  return {
    myProperty: $persist(false)
  }
});

Replies: 1 comment

Comment options

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