If youāve ever written the same watch + execute + loading dance in multiple Vue components, youāre not alone.
Iāve been doing that too ā until I built vueāmuzaāuse, my APIālayer library for Vue 3.
In versions 0.9.0 and 0.10.0, I killed several small, but very annoying dataāfetching patterns that kept repeating across codebases.
Hereās how I did it, and why you probably donāt want them in your components anymore.
š” vueāmuzaāuse 0.9.0 ā what changed
Over the last month, vueāmuzaāuse has already reduced the amount of APIārelated code by 2ā3x in four production projects.
Notable additions:
-
watch+ reactivedata/paramsā subscribe directly insideuseApi, instead of adding a separatewatchevery time. You declare what to watch, and the library handles the rest. -
ignoreUpdatesā turns off automatic reāfiring when you update filters, inspired bywatchIgnorablefrom VueUse, but built into the composable. Makes request behavior explicit and predictable. - lightweight cache ā just
cache: 'categories'on GET andinvalidateCache: 'categories'on POST/PUT/DELETE. No subscriptions, no complex logic, just ināmemory caching and explicit invalidation.
Right now, there are about 170 tests, and Iām focusing on making the API match what you already know from Vue ā watch, immediate, refs ā so you donāt have to learn anything entirely new.
Why should you try vueāmuzaāuse?
- It builds on what you already know:
watch,immediate, reactive refs. No paradigm shift, no extra concepts. - The library is small and takes about 5ā10 minutes to configure.
- Builtāin
refreshTokensupport with a readyātoāgo queue logic ā just plug it into a plugin with 5ā10 lines of code. - And starting with 0.10.0, thereās a Claude Code skill that knows your
useApi<TRaw, TSelected>pattern and all options (SWR,poll,watch,select,cache,ignoreUpdates), so you donāt need to āteachā AI every time.
If you want to talk, walk through a useācase, or just have a quick devācall ā Iām open to chat š
š npm: https://www.npmjs.com/package/@ametie/vue-muza-use
š GitHub: https://github.com/MortyQ/vue-useApi
Top comments (0)