[useFetch] Dependent Fetching
Kopf02 opened this issue · comments
Clear and concise description of the problem
As developer using VueUse using useFetch I want to be able to fetch Data depending on other fetches Response so that I'm able to use useFetch in more complex cases when I need a context of a request to even perform the second Request.
For example I need to perform a search and the Result doesn't contain the full data. I need the ID Returned from the search request to then get the Resource itself.
Suggested solution
In useFetch you could allow the URL to accept undefined / false / null. If you provide undefined / false / null the Request istn't performed initially. Instead it watches the URL until it contain a String to fetch.
Alternative
No response
Additional context
The Vue Plugin SWRV provides similar functionality and could be used as a reference. It isn't as flexible in its usage as useFetch. That's why I would rly enjoy useFetch to provide similar functionality.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.