woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.02k stars 38 forks source link

Only run SSR once on mount #1

Closed woutdp closed 1 year ago

woutdp commented 1 year ago

Currently we invoke the SSR render call on every update, this should only happen on mount.

I've found it difficult to achieve as the mount doesn't have the assign attributes and the update and preload function don't actually update the attributes.

I think the way of going about it is setting the state in the parent LiveView somehow and then check if it already ran the SSR render