flawiddsouza / Restfox

Offline-First Minimalistic HTTP & Socket Testing Client for the Web & Desktop
https://restfox.dev
MIT License
1.96k stars 96 forks source link

Improvement: Make store hydrate to localstorage if needed #108

Open eznix86 opened 5 months ago

eznix86 commented 5 months ago

Instead we can do,

Example here: https://www.mikestreety.co.uk/blog/vue-js-using-localstorage-with-the-vuex-store/

app <-> state <-> update storage on mutation / fetch state on boot.

Benefits:

flawiddsouza commented 5 months ago

Sounds like a good improvement. But we don't need to persist everything in the store to the localStorage. If we can limit it to the items that are used for configuring the application, that would be better. I've been planning to move away from localStorage but I never got the time to do it. This would mean we'd have to migrate the existing user configuration as well, as we can't have users suddenly losing their existing settings because there's a new update to the settings system.

eznix86 commented 5 months ago

I agree, but I think we can prevent a breaking change if we do it meticulously.

Just proposing to make it simpler because when coding on the previous PR, It seems weird to always update the storage then change the store.