0👍
If you want to have a more generic namespaced module, you can use global Vuex actions: https://vuex.vuejs.org/api/#dispatch
This paired with rootState
https://vuex.vuejs.org/api/#mutations
Would be enough to make something generic. I’ve achieved it this way with some dynamic interpolation and conditional. Beware of not making it too complex tho, 100% DRY is not always the best. Sometimes some repetition can be totally fine!
- [Vuejs]-How to update DOM with value returned from Axios?
- [Vuejs]-Vue js axios get request error – Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present
Source:stackexchange.com