|
|
|
|
|
by parr0t
2908 days ago
|
|
Interesting timing with coming across this article for me. I have started developing re-designing our site frontend to use Vue with Vuex and the point this author makes about where to put the API logic also made me scratch my head a bit. Sometimes I just need to make a simple API call that does not alter the application state and just needs to grab some information and render said information in 1 component. Technically, in the component, I can just call Axios and get the data then and there, but then I have other components such as the Login that does need to set some Vuex state and therefore that's abstracted away further in the actions/API class as all documentation seems to suggest that's what you should do. I suppose I am just finding it a bit of a challenge to keep things a) consistent and b) not overly abstracted for the task at hand. |
|