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

expose AsyncDataRequestStatus from useAsyncData #26022

Closed
3 of 4 tasks
drevantonder opened this issue Mar 1, 2024 · 0 comments · Fixed by #26023
Closed
3 of 4 tasks

expose AsyncDataRequestStatus from useAsyncData #26022

drevantonder opened this issue Mar 1, 2024 · 0 comments · Fixed by #26023

Comments

@drevantonder
Copy link
Contributor

Describe the feature

When using status from useAsyncData and family as a prop, it would be great to be able to type it using AsyncDataRequestStatus from packages/nuxt/src/app/composables/asyncData.ts.

e.g. rather than having to do:

<script setup lang="ts">
import type { AsyncData } from "#app";
import type { UnwrapRef } from "vue";

withDefaults(
  defineProps<{
    status: UnwrapRef<AsyncData<any, any>["status"]>;
  }>(),
  {
    status: "success",
  }
);
</script>

You can do:

<script setup lang="ts">
import type { AsyncDataRequestStatus } from "#app";

withDefaults(
  defineProps<{
    status: AsyncDataRequestStatus;
  }>(),
  {
    status: "success",
  }
);
</script>

Additional information

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

Final checks

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

Successfully merging a pull request may close this issue.

1 participant