rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
5.85k stars 894 forks source link

Recreate Notifiers on rebuild #3393

Closed rrousselGit closed 2 months ago

rrousselGit commented 2 months ago

This enables the usage of ref.mounted, to easily check if a provider is currently active or not.

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: b80c6cc95d383113fa0e6b87930066f31c72e9bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.39%. Comparing base (5076132) to head (b80c6cc).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393/graphs/tree.svg?width=650&height=150&src=pr&token=YLNY78nI5y&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet)](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet) ```diff @@ Coverage Diff @@ ## dev #3393 +/- ## ========================================== - Coverage 93.46% 93.39% -0.08% ========================================== Files 43 43 Lines 2297 2287 -10 ========================================== - Hits 2147 2136 -11 - Misses 150 151 +1 ``` | [Files](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet) | Coverage Δ | | |---|---|---| | [...ckages/riverpod/lib/src/core/modifiers/future.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9jb3JlL21vZGlmaWVycy9mdXR1cmUuZGFydA==) | `100.00% <100.00%> (ø)` | | | [...erpod/lib/src/core/provider/notifier\_provider.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9jb3JlL3Byb3ZpZGVyL25vdGlmaWVyX3Byb3ZpZGVyLmRhcnQ=) | `93.02% <100.00%> (-1.21%)` | :arrow_down: | | [...ges/riverpod/lib/src/providers/async\_notifier.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9wcm92aWRlcnMvYXN5bmNfbm90aWZpZXIuZGFydA==) | `100.00% <ø> (ø)` | | | [...es/riverpod/lib/src/providers/future\_provider.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9wcm92aWRlcnMvZnV0dXJlX3Byb3ZpZGVyLmRhcnQ=) | `93.33% <ø> (ø)` | | | [packages/riverpod/lib/src/providers/notifier.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9wcm92aWRlcnMvbm90aWZpZXIuZGFydA==) | `91.66% <ø> (-8.34%)` | :arrow_down: | | [...es/riverpod/lib/src/providers/stream\_notifier.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9wcm92aWRlcnMvc3RyZWFtX25vdGlmaWVyLmRhcnQ=) | `100.00% <100.00%> (ø)` | | | [...es/riverpod/lib/src/providers/stream\_provider.dart](https://app.codecov.io/gh/rrousselGit/riverpod/pull/3393?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Remi+Rousselet#diff-cGFja2FnZXMvcml2ZXJwb2QvbGliL3NyYy9wcm92aWRlcnMvc3RyZWFtX3Byb3ZpZGVyLmRhcnQ=) | `95.45% <ø> (ø)` | |