Skip to content

Conversation

@PaulyBearCoding
Copy link
Contributor

Description

This PR adds documentation for the pending field returned by useAsyncData, which was previously undocumented.

Changes

  • Added pending to the usage example
  • Added pending to the Return Values section

Context

The pending field is part of the AsyncData interface (defined in packages/nuxt/src/app/composables/asyncData.ts) but was not documented in the API reference.

Fixes #32956

Add documentation for the  field that is returned by useAsyncData.
This field is part of the AsyncData interface but was not documented.

- Add pending to usage example
- Add pending to Return Values section

Fixes nuxt#32956
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Oct 28, 2025

Walkthrough

The documentation for the useAsyncData composable has been updated to reflect a new pending property added to the AsyncData return type. This property is a Ref<boolean> that indicates whether a data fetch is currently in progress. The change includes updates to usage examples demonstrating destructuring of the pending property, revised return value documentation, and the corresponding public type signature for the AsyncData generic type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Type definition updates to the public AsyncData<DataT, ErrorT> interface adding the pending: Ref<boolean> property
  • Consistency between example code, return value documentation, and type declarations
  • Verification that the property name and type align across all documentation references

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "docs(useAsyncData): add missing pending field documentation" is directly related to the main change in the changeset. It uses the standard documentation prefix "docs()" to indicate this is a documentation update, identifies the specific composable being documented "useAsyncData", and clearly describes the action being taken "add missing pending field documentation". The title is concise, specific, and would allow a teammate scanning the repository history to immediately understand that this PR documents a previously undocumented feature.
Linked Issues Check ✅ Passed The PR directly fulfils the requirements of linked issue #32956, which requested that the pending field be documented in the useAsyncData API reference. The raw summary confirms that the pending property has been added to the usage example and to the Return Values documentation section, with the public entity signature now including pending: Ref<boolean>. The changes address the core requirement that pending was missing from the official API documentation despite being part of the AsyncData interface definition.
Out of Scope Changes Check ✅ Passed All changes in the PR are directly within scope of the linked issue #32956. The modifications are limited to the useAsyncData documentation file (docs/3.api/2.composables/use-async-data.md) and focus exclusively on adding documentation for the pending field to the usage example and Return Values section. There are no unrelated changes, code modifications outside of documentation, or alterations that deviate from the stated objective of documenting the previously undocumented pending field.
Description Check ✅ Passed The PR description is clearly related to the changeset and provides meaningful context. It specifically describes what was changed (the pending field was added to the usage example and Return Values section), explains the rationale (the field exists in the interface but was not documented), and references the related issue. The description is neither vague nor generic; it conveys substantive information about the documentation updates being made and includes the issue number for traceability.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b688187 and b8d7b2e.

📒 Files selected for processing (1)
  • docs/3.api/2.composables/use-async-data.md (2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/3.api/2.composables/use-async-data.md

[uncategorized] ~153-~153: Loose punctuation mark.
Context: ... function that is passed in. - pending: a boolean indicating whether the data i...

(UNLIKELY_OPENING_PUNCTUATION)

🔇 Additional comments (1)
docs/3.api/2.composables/use-async-data.md (1)

21-24: Documentation changes for pending in usage example and return values look good.

The addition of pending to the usage example (line 21) and the return values documentation (line 153) are accurate and clearly describe the new field. Once the type definition is corrected, the documentation will be complete and consistent.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe
Copy link
Member

we should probably resolve via #33221, but thank you for taking the time to open this PR ❤️

@danielroe
Copy link
Member

(I've merged that one in with you listed as a co-author.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The pending field for AsyncData is undocumented

2 participants