-
-
Notifications
You must be signed in to change notification settings - Fork 64
docs: add comprehensive status vs asyncStatus guide to queries #359
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for funny-banoffee-0afb46 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- replace details section with prominent guide explaining data vs async status - include practical examples showing stale-while-revalidate patterns - add advanced UI state examples with computed derived states - provide clear usage guidelines for when to use each status type
|
|
||
| ## Understanding Query Status vs Async Status | ||
|
|
||
| One of the key features that makes Pinia Colada powerful is the distinction between **data status** (`status`) and **async status** (`asyncStatus`). Understanding this difference is crucial for building great user experiences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too verbose and says nothing
| </template> | ||
| ``` | ||
|
|
||
| ### Advanced UI States |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section can be fully removed
| </template> | ||
| ``` | ||
|
|
||
| ### When to Use Which Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a verbose summary. Remove all redundant info and condense into two or three senyences
This PR addresses the issue where the documentation lacked sufficient explanation of the difference between
statusandasyncStatusin Pinia Colada queries.Problem
The existing documentation only had a brief explanation buried in a collapsible details section, which was insufficient for developers to understand when and how to use each status type effectively. This led to confusion about:
status) and async status (asyncStatus)Solution
Added a comprehensive new section "Understanding Query Status vs Async Status" to the queries guide that includes:
Clear Conceptual Explanation
status): Represents the state of your data ('pending','success','error')asyncStatus): Represents the current fetch operation ('idle','loading')Real-world Scenarios
status: 'pending'+asyncStatus: 'loading'status: 'success'+asyncStatus: 'idle'status: 'success'+asyncStatus: 'loading'status: 'success'+asyncStatus: 'loading'Practical Examples
Advanced Patterns
Added examples showing how to combine both statuses for sophisticated UX patterns, including computed derived states for complex loading scenarios.
Usage Guidelines
Clear recommendations on when to use each status type:
statusfor data-related decisions (showing data, errors, type narrowing)asyncStatusfor operation-related UI (loading spinners, button states)Impact
This improvement makes the dual status concept much more accessible to developers, enabling them to build better user experiences with proper loading states and stale-while-revalidate patterns. The section is now prominently placed in the queries guide rather than hidden in a details section.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.