You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's really easy to miss calls to saveState(). Is it worth revisiting proxies in order to hook one up to call saveState() every time state gets set and scrap all other calls to saveState()? Feels like it'd be a lot more intuitive to just assume it's being saved every time you set it unless there's a situation where you'd want to set it and not save right away that I'm not considering
Yeah, it's definitely a potential issue. I originally wanted to avoid this because calls to localStorage.set, or saving state, are a lot more negatively performance impacting than setting an object.
I could run a check every 5 seconds to see if the state has changed, and if it has, save it. Then we wouldn't have to worry about calling state. What do you think?
Oh that makes sense, I wasn't thinking a proxy's set: on state would be triggered too often but maybe I'm underestimating that lol, checking every 5 seconds would definitely work as a nice safety net
It's really easy to miss calls to
saveState()
. Is it worth revisiting proxies in order to hook one up to callsaveState()
every time state gets set and scrap all other calls tosaveState()
? Feels like it'd be a lot more intuitive to just assume it's being saved every time you set it unless there's a situation where you'd want to set it and not save right away that I'm not consideringHordesUIMod/src/mods/draggableUI/index.js
Lines 38 to 45 in ed4edcb
The text was updated successfully, but these errors were encountered: