L5E docscontent/21-nanostore-shared-state.md

Nanostore & shared-state pitfalls

  • Use nanostores as a tiny cross-island bus; subscribe from vanilla scripts too.
  • Pitfall: each chunk imports its own store unless the module is shared — check bundling.
  • Pitfall: SSR has no client state; never read a store during render, only inside listeners.