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

Add AsyncValue documentation #3500

Open
snapsl opened this issue Apr 24, 2024 · 5 comments
Open

Add AsyncValue documentation #3500

snapsl opened this issue Apr 24, 2024 · 5 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@snapsl
Copy link

snapsl commented Apr 24, 2024

Make riverpod onboarding easier.

AsyncValue is a core feature of riverpod when we use AsyncNotifier / FutureProvider, but is not explained in the documentation.
Currently new user have to look into the api reference or source code to get basic information.

The documentation should contain:

  • what is AsyncValue
    • utiltiy class
    • AsyncData /AsyncLoading / AsyncError
  • how to use AsyncValue
    • modifying an async value
    • .guard()
    • resolve async value (map / pattern matching / value / valueOrNull)

In case information is missing, feel free to add them.

If needed, I can contribute to the docs.

@snapsl snapsl added documentation Improvements or additions to documentation needs triage labels Apr 24, 2024
@rrousselGit
Copy link
Owner

Sounds like this overlaps with the API reference.

It's normal IMO that folks have to look at the API reference if they want docs about a very specific thing.

@rrousselGit rrousselGit added question Further information is requested and removed needs triage labels Apr 24, 2024
@snapsl
Copy link
Author

snapsl commented Apr 24, 2024

Yes, it will overlap.
But, since AsyncValue is exclusiv to riverpod and needed for FutureProvider / AsyncNotifier, a new user has no information about this concept.
The documentation could give a small introduction to AsyncValue and how to use it.
A detailed description of the individual methods that AsyncValue provides is of course part of the API reference.

@rrousselGit
Copy link
Owner

I don't like the idea of having an overlap with the API reference.

If we want to improve AsyncValue's docs, I'd rather update the API reference to have better docs. Then link the AsyncValue's dartdoc page better in the doc.

Duplicate content will get out of sync.

@snapsl
Copy link
Author

snapsl commented May 13, 2024

If we want to improve AsyncValue's docs, I'd rather update the API reference to have better docs. Then link the AsyncValue's dartdoc page better in the doc.

Maybe it is possible to link the api reference with the documentation similar to how Signals does it.

@rrousselGit
Copy link
Owner

I'm planning on having a way to extract dartdoc and put it into the website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants