Saving state in live view

Hi!
Is it possible to save state of LiveView “component” before switch to another LiveView “component” and load it back when first component will be rendered again?

1 Like

Yes, it is possible. You can use external store for the data (ex. additional GenServer) or you can use terminate/2 callback to store data somewhere and load it on mount again.

1 Like

Indeed, thanks!