[useFetch] Method execute should accept a config argument - same as useAxios
wouterkroes opened this issue · comments
Clear and concise description of the problem
As a developer using VueUse, the useFetch's method execute
should accept a config argument. This will eliminate the need to resort to useAxios. Currently, I opt for useAxios because its execute method supports this config argument.
I prefer leveraging useFetch over useAxios due to several key benefits:
- No need to install the Axios dependency separately.
- Smaller distribution package, as Axios has known tree-shaking issues (see axios/axios#5598 and axios/axios#5380).
I'd like to contribute a PR for this feature request, but I'd appreciate the opportunity to collaborate and coordinate with someone beforehand.
Suggested solution
compare useFetch execute (https://github.com/vueuse/vueuse/blob/main/packages/core/useFetch/index.ts) with useAxios execute (https://github.com/vueuse/vueuse/blob/main/packages/integrations/useAxios/index.ts) and add the actual implementation
Alternative
if adding a config argument to useFetch method execute
is not desired/possible, keep using useAxios is a fine alternative for me.
Additional context
No response
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.