Is there a way to hook up saving UI state to the tab-closing event in browser?
I was trying to use
ViewModel.onCleared
from the multiplatform view model to save its state (via KStore), but it didn't work. I want to be able to load the same cached UI state on tab reloading from the Web Storage, what is the best way to go about it?
p
Pablichjenkov
11/09/2024, 5:33 PM
Why not saving it in the remote database?
p
pierbezuhoff
11/09/2024, 6:00 PM
The issue for me is not saving, but when to save. Do i have to auto save my UI state like every minute, or is there a way to only save it when the user closes the tab?