Share a pinia store between instances of a web component
Hi @EranGrin
Is there a way to share a synced pinia store between different instances of the same component?
For example, if I have a
When setting the state of one store I would like all of the instances to share the same state.
Thanks!
This is indeed an interesting use case, I'll try to look into it in the coming days.
The question is actually if pinia can support store between multiple vue instances, if you can find a way to do it, I would be eager to help to adapt this to the web component. Otherwise, the issue isn't in the scope of this plugin.
Hi Eran,
Looks like it's possible here (I didn't test it): https://gist.github.com/posva/28604e178deb5d5c9ab6cea86232053b
My current workaround is to use localStorage with the pinia persist plugin to communicate between the web components, but it's not the best solution.
Thanks
Looks promising, I would try to dive into it in the coming days