Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Vue 3 Composition API

Refactoring for a More Versatile Composable thumbnail image

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Refactoring for a More Versatile Composable

In this lesson, we create a useResource composable to handle the fetching logic and state for both posts and users.

Along the way, we get to see the flexibility composables provide when it comes to renaming data and functions to prevent naming collisions across composables.

Finally, we examine the ability to pass parameters to composables in order to make them even more versatile.