S
SolidJS3mo ago
mpeg

State sharing between Islands

I have a client that I'm leading a site rebuild for, and we're potentially thinking of switching to Solid They run on a very particular old enterprisey tech stack which means that while the app is fully client side rendered, it gets rendered into multiple roots instead of there being a single component tree. What is the best approach to sharing state between these islands? Can Solid signals be used outside of a Solid tree for this? Should I use a separate solution for it, I saw Astro recommends nanostores Thanks in advance
2 Replies
Adam Goldstein
Adam Goldstein3mo ago
My understanding is it should work fine as the roots handle disposal. If you create the signal statically, there shouldn't be a problem, you can have memory leaks if you create them dynamically though without wrapping them in a createRoot. Please someone correct me if I'm wrong though!
mpeg
mpegOP3mo ago
Thanks for the reply, so it should be fine to use signals outside the solid component tree, I’ll give that a go to put together a poc
Want results from more Discord servers?
Add your server