-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove pending
in favor of status
in data fetching composables
#25225
Comments
pending
in favor of status
in data fetching composablespending
in favor of status
in data fetching composables
@danielroe @DamianGlowala Can i work on this? |
You're welcome to open a PR but we probably won't merge it until we're ready to migrate to Nuxt 4. You might also consider initial work on writing a codemod to migrate people's code to the new format. |
@danielroe I am a little confused on how to replace |
why not just use pending as a computed value of |
@danielroe Wouldn't it be better to keep Imho the following comment from @drowhannn already shows that it is a bad idea to remove the flag, because everybody will be confused as well with this change.
To sum up: Why removing a convenient well established flag? |
I want to be able to use status.pending, instead of status === 'pending'? |
If you want the same behavior as before, use
@fen89 @ctigrisht Would be an option but will break code without people realizing. |
I'm strongly against removing the pending variable. It's incredibly convenient to use and a enables a very common pattern. It works beautifully with Suspense and v-if, is very concise to write and read. |
Describe the feature
Currently, data fetching composables expose pending information in two ways:
pending
andstatus
(status.value === 'pending'
). It would be great to consider removingpending
for consistency, which currently has a duplicated source of truth. As this would be a breaking change, it's probably best to address it in the next version of Nuxt.Additional information
Final checks
The text was updated successfully, but these errors were encountered: