Skip to content

Mixed use of ofetch and $fetch #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
septatrix opened this issue May 16, 2024 · 3 comments · Fixed by #106
Closed

Mixed use of ofetch and $fetch #90

septatrix opened this issue May 16, 2024 · 3 comments · Fixed by #106

Comments

@septatrix
Copy link

While reading the codebase (to potentially implement #89, most likely based on the existing Keycloak provider) I noticed that some places use ofetch and others use $fetch. Is there a specific reason for this? Otherwise it might be wise to unify them and use one of the two consistently throughout the codebase.

@amandesai01
Copy link

amandesai01 commented May 22, 2024

$fetch = ofetch
ref: https://nuxt.com/docs/getting-started/data-fetching#fetch

TLDR from the link;

Nuxt includes the [ofetch](https://github.com/unjs/ofetch) library, and is auto-imported as the $fetch alias globally across your application.

If this answers your questions, feel free to close the issue.

@septatrix
Copy link
Author

I knew that $fetch is at least some wrapper over ofetch. However, if there is no difference, I would reason that only one of the two should be used consistently throughout the codebase

Copy link
Owner

atinux commented Jun 5, 2024

I am happy to move everything to $fetch.

Anyone happy to open a PR for this? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants