Vue 3 Composition API

Watch this course for FREE this weekend only.
Create an account to start watching.

or

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.