Alpine unified state #4609
0xDjole
started this conversation in
3. Feature Ideas
Replies: 1 comment 4 replies
-
The issue with global stores is how would you simply have 8 of the same component on the page? I don't see how that would be easier at all.
You can already do this with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After using Alpine, I have come to the conclusion that global stores in Alpine are extremely powerful.
I've been using it with Astro.JS and most of my components don't even have imports or script tags...Almost all the logic is written inside plain .ts file containing global store, reactive variables with Alpine watch and event persistent parts. Its beautiful.
I believe if this project was to unify state ( and pretty much ditch x-data completely ) like Svelte 5 did with runes and only rely on global stores as a single way to do stuff, the project would be way more successful, as global stores can do anything local ones can.
I suppose this is not a feature request, but rather a request to remove a feature. I'm sure I'm missing something but unifying state is almost 100% way to go especially since the aim of Alpine is to be lightweight and would be easier for the devs.
Additionally instead of spamming $store to access stores, I'd add store alias ( $cart for example ) telling us it's a global store. ( Or if this magically gets into a real discussion, $ would just reference a regular unified state )
Beta Was this translation helpful? Give feedback.
All reactions