Skip to content

How can I use pinecone-router together with Alpine.store() object? #63

Closed Answered by rehhouari
Kimotu asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reporting and sorry for the inconvenience. I don't know how this passed me, template elements should be initialized with the proper context, including this.$store, I'm looking into it

You're defining the store wrong, second argument should be an object not a function. please refer to the docs

document.addEventListener('alpine:init', () => {
  Alpine.store('books', {
	  books: [],
	  message: 'Hello',
	  async init() {
		  // this.books = this.getBooks();
		  this.books = ['one', 'two'];
	  },
  });
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rehhouari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
invalid This doesn't seem right
2 participants