This is a suggestion based on a similar useFetch() implementation from project vue-async-function.
Instead of just invoking fetch() in component mounted lifecycle hook, you could make useFetch(url) support a reactive wrapper for url argument, so it could watch() for URL changes and trigger another fetch(url) call whenever url changes. This could be useful e.g. in search boxes, when url changes based on the text to be searched.
This is a suggestion based on a similar
useFetch()implementation from project vue-async-function.Instead of just invoking
fetch()in componentmountedlifecycle hook, you could makeuseFetch(url)support a reactive wrapper forurlargument, so it couldwatch()for URL changes and trigger anotherfetch(url)call wheneverurlchanges. This could be useful e.g. in search boxes, whenurlchanges based on the text to be searched.