onCleanup in Root component?
o/ so i have this component in my root. if i refresh the page, it doesn't log the
cleaning up root!!
message. is there any other way to run code when the app stops/refreshes?
3 Replies
nvm, found i could do
but is onCleanup() just not going to work for roots?
roots aren't disposed when the page unloads
if you want to do that then you could probably do like
though i don't know if that's necessarily a good idea if there's a lot to clean up
i just want to save something to localStorage
i had it earier as a store and the localStorage was saved inside an effect, but since i update the data a lot (10+ times/s) i figured out that's a bit inefficient