-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
refactor(nuxt): simplify request
computation inside useFetch
#26191
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
Conversation
|
request
computation with toRef
request
computation with toRef
I'd like to understand if using a getter function as the parameter for Of course, for users passing in a type of |
Does |
As an adjustment, perhaps it could be modified like this: const _request = computed(() => toValue(request)) Or const _request = typeof request === 'function' ? computed(request ) : toRef(request) |
I think |
request
computation with toRef
request
computation inside useFetch
π Linked issue
N/A
β Type of change
π Description
Currently, the implementation of
_request
insideuseFetch
is as follows:nuxt/packages/nuxt/src/app/composables/fetch.ts
Lines 97 to 103 in ac54da2
This code is almost equivalent to
toRef(request)
, should we just usetoRef
as a cleaner alternative?I am open to feedback regarding whether this adjustment will yield significant benefits. Should the evaluation indicate that the drawbacks outweigh the benefits, please feel free to close this PR.
π Checklist