Fetching data in Pinia store - useFetch make sense here?
I have Nuxt app with Pinia. In one store, I find myself using
This provides pretty damn clean API, with status and error baked in.
But when I looked for examples of Pinia with useFetch, I couldn't find any. All the AI GTPs suggest exposing a function to fetch data (e.g, fetchItems()), while using $fetch.
Am I missing something here? Any reason to not useFetch on store setup?
useFetch for data fetching (with SSR support), then expose the status, error and another computed variable which does some computation on the data returned. This provides pretty damn clean API, with status and error baked in.
But when I looked for examples of Pinia with useFetch, I couldn't find any. All the AI GTPs suggest exposing a function to fetch data (e.g, fetchItems()), while using $fetch.
Am I missing something here? Any reason to not useFetch on store setup?
