Skip to content
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

Open
3 of 4 tasks
DamianGlowala opened this issue Jan 16, 2024 · 5 comments · May be fixed by #25864
Open
3 of 4 tasks

Remove pending in favor of status in data fetching composables #25225

DamianGlowala opened this issue Jan 16, 2024 · 5 comments · May be fixed by #25864

Comments

@DamianGlowala
Copy link
Member

Describe the feature

Currently, data fetching composables expose pending information in two ways: pending and status (status.value === 'pending'). It would be great to consider removing pending 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

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@DamianGlowala DamianGlowala added this to the 4.0 milestone Jan 16, 2024
@DamianGlowala DamianGlowala changed the title Removing pending in favor of status in data fetching composables Remove pending in favor of status in data fetching composables Jan 19, 2024
@drowhannn
Copy link

@danielroe @DamianGlowala Can i work on this?

@danielroe
Copy link
Member

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.

@drowhannn
Copy link

drowhannn commented Feb 16, 2024

@danielroe I am a little confused on how to replace pending.value in docs and tests. Should i replace it with status.value === "pending" or status.value === "idle" || status.value === "pending" || !data.value

@drowhannn drowhannn linked a pull request Feb 19, 2024 that will close this issue
9 tasks
@ctigrisht
Copy link

why not just use pending as a computed value of status.value === "pending" so you don't break compatibility?

@fen89
Copy link

fen89 commented Apr 16, 2024

@danielroe Wouldn't it be better to keep pending as a computed, as @ctigrisht said - this is a convenient wrapper for useFetch; if this doesn't exist anymore then we need to add the good old boilerplate stuff again and again everywhere.

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.

I am a little confused on how to replace pending.value in docs and tests. Should i replace it with status.value === "pending" or status.value === "idle" || status.value === "pending" || !data.value

To sum up: Why removing a convenient well established flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Approved
Development

Successfully merging a pull request may close this issue.

5 participants