Vue 3 Composition API
Plans from $25/month

This lesson is for members. Join us?

Subscribe now and get immediate access to this course, 30 more and all future Vue.js courses!

Using the usePost Composable in Multiple Components

In this lesson, we extend the usePost composable to handle not just an API call to retrieve all the posts but also an API call to get a single post. Because Vue.js composables are external to components, this means we can group our logic concerning post retrieval into a single file (the composable) and then reuse the composable across multiple components.