Hi! Ever was wondering what is a State manager in Vue.js? How to use it? When to use it? Why not just use Props / Emits? Check this out and hopefully you'll get answers to :) Enjoy!
Nice....2 questions here: 1) What is difference between options stores and setup stores? 2) What does the id parameter @10:12 signify? meaning why it is used for? If you can explain this it will be super helpful....Also not sure what is the difference between 'watch' and 'computed' in vue3....I find your videos super helpful hence I want to clarify these doubts....thank you so much
1. In an Options store everything you create within State / Actions / Getters is available for usage from outside. If you use Setup store you can specify what you want to use and return { only that } 2. This kind of a Name of the store that Pinia will later on use to connect your Store with Vue dev tools. 3. Main difference between Watch and Computed is that in Watch you have an access to Old Value and New Value by default. Computed can only track one, latest Value if it has a Set() function. More about Pinia's Stores you can find in their DOCs: pinia.vuejs.org/core-concepts/