Great post! I’d suggest decoupling your services from axios, so you can easily separate concerns and eventually replace axios with other solution. Probably a good way of achieving so is by injecting axios to your service (Dependency Injection).

But again, great post! I’ve struggled several times with the api/services architecture. I used to use Vuex for them, but the coupling was so heavy that it became really hard to reason or refactor. Now I follow the same approach you outlined here.

Words matter — Frontend development, CSS, UX, design, lean, agile and everything in between. https://afontcu.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store