Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

5-7 Creating the useFetchWithCache Composable

In this lesson, we’ll create a more generic composable for fetching, useFetchWithCache. With this composable, we’re able to fetch data from both of the endpoints that we’ve created.

Through this composable, we’ll also explore how to use TypeScript generics to create a reusable composable that can be used with any type that we need.