DEV Community

loading...
Cover image for How to build Vue composition apps.

How to build Vue composition apps.

kaloyanyosifov profile image Kaloqn ・2 min read

Hey everybody!!!

Last month I was working on a new project at my work and was using the Vue composition API. I had about 6-7 months of experience on the new composition API of Vue and was ready to tackle it.

As I was writing the new requirements, a colleague came by and looked at how I was writing code for retrieving data from the server. On 3 or more components I had used the same features like loading, error handling, and handling data. I give it another thought and started creating a new composition function, to encapsulate the logic of fetching data from an API.

He stopped me and showed me how the React community is doing it with React Query.

I was pretty pumped up and wanted to use it on my Vue project, but with no luck. Because there is no such thing for Vue. I was like WHAT!?!??!

image

Then I started working on Vue Query. It has the same concepts as React Query, but it is written with support for both Vue 3 and the composition API library.

Currently, the features that are integrated are:

  • Key Caching
  • Pagination Support
  • Mutating Cache State
  • and more.

Check out the video below, to see a quick tutorial on how everything is working. And most importantly give us your feedback on what we should improve or if you like the idea for Vue support.

Vue Query Tutorial Video!!!!!
Vue Query
Vue Query Examples
Vue Query Example site

Discussion (0)

pic
Editor guide