TypeScript issues with useAsyncData
Hello, i want to have async data that fetches some api endpoint based on a route parameter.
However, if i am on a route that doesn't have this parameter, no data should be fetched and the result should be null.
(all of this is part of a Pinia store)
At the moment, i use this:
The delay is there to not set the value immediate to null because that flickers on a page that uses this data if i'm navigating away from it.
This does work, but my IDE/Typescript Inspections say that my call of useAsyncData doesnt match an overload.
Is there something I could do about this or should I just ignore it?
1 Reply
If you have other improvements, please tell me, i'm pretty new to Nuxt :)