Hi VueJS lowers!

After the story with my friend Philipp and his bakery, we finally opened the SOLID principles topic. To continue improving our VueJS skills I’d like to start a new section I called “Vue tricks” where I’ll share my mind about some interesting moments during my work with amazing VueJS.

During the last time, Philipp had some difficulties in his bakery with connecting to API services. Today I’d like to talk about smart API module for Vue and Vuex. Probably, sometimes or event often you noticed that your api connection code is not consistent and looks like a mess. In this article I will share how to create a new API module you can easily use in your Vue components and Vuex actions just typing

this.$api.tasks.fetch()

and all (in this case) tasks will be fetched into your component or store.

In this project I decided do not use my favorite TypeScript, because, I suppose, many people are not using it with VueJS and just concentrate on pure JavaScript. Let’s get started!

#javascript #vuex #vue #api #developer

Vue Tricks: Smart API Module for VueJS
2.70 GEEK