Access the Global Store: $store
Explore how to use AlpineJS stores and the $store magic property to share global data across components. Understand accessing single values, objects, and methods to create organized, interactive features like dark mode.
We'll cover the following...
We'll cover the following...
AlpineJS stores
Sometimes, our components may need data in order for them to work well. We can define this data using AlpineJS stores. An AlpineJS store is data defined in an Alpine.store global method. Even though AlpineJS stores are not persistent, we can use them to provide data to our components. This data can then be ...