3 ms·
I use vuex with namespaced modules, but then those modules just call out to abstracted implementations if it's more than just http request. So for example with
by philliphaydon 8y ago
I use vuex with namespaced modules, but then those modules just call out to abstracted implementations if it's more than just http request. So for example with auth, I have a vuex auth module.
It then has some getters which just get the state from the store, but the actions call to a separate module which manages storing it in LocalStorage or making the http requests.
Works for me, but I just took what I learned (Vue) moved it to when I learned a year later (Vuex), when things became complicated in Vuex I just moved the complicated bits back 1 bit more and everything became simple again (which seemed like the logical thing to do).