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 test arg to AsyncValue.guard #3292

Merged
merged 7 commits into from
Jan 29, 2024

Conversation

utamori
Copy link
Contributor

@utamori utamori commented Jan 21, 2024

Related Issues

fixes #3291

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).

  • I have updated the CHANGELOG.md of the relevant packages.
    Changelog files must be edited under the form:

    ## Unreleased fix/major/minor
    
    - Description of your change. (thanks to @yourGithubId)
  • If this contains new features or behavior changes,
    I have updated the documentation to match those changes.

Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a0b8d21) 95.16% compared to head (b478065) 95.16%.

❗ Current head b478065 differs from pull request most recent head c2aa9e9. Consider uploading reports for the commit c2aa9e9 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3292   +/-   ##
=======================================
  Coverage   95.16%   95.16%           
=======================================
  Files          53       53           
  Lines        2295     2298    +3     
=======================================
+ Hits         2184     2187    +3     
  Misses        111      111           
Files Coverage Δ
packages/riverpod/lib/src/common.dart 100.00% <100.00%> (ø)

@rrousselGit
Copy link
Owner

Thanks for this!
Make sure to update the changelog and docs, as per the issue template :)

@@ -157,12 +157,24 @@ abstract class AsyncValue<T> {
/// });
/// }
/// }
///
/// when predicate is provided, and it is false; rethrown.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've edited the code-snippet. Explanation should be outside of the ```

Also, could you expand on it a bit more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added it.

@@ -2,6 +2,7 @@

- Improved `Provider(dependencies: [...])` documentation.
- Fix out of date `pub.dev` description
- Add `predicate` argument to `AsyncValue.guard` method. (thanks to @utamori)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new feature. Update the heading to Unreleased minor

@utamori utamori changed the title Add guard predicate to AsyncValue.guard Add guard test to AsyncValue.guard Jan 29, 2024
@utamori utamori changed the title Add guard test to AsyncValue.guard Add test arg to AsyncValue.guard Jan 29, 2024
@rrousselGit
Copy link
Owner

LGTM, thanks!

@rrousselGit rrousselGit merged commit 31d478f into rrousselGit:master Jan 29, 2024
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support to specify exception type on AsyncValue.guard
2 participants