You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the comments for AsyncValue.value says both "It will return the previous value during loading/error state" and "This will return null during loading/error states". These seem contradictory.
The comment is very descriptive. AsyncValue.value will return the previous value during loading/error state if a previous value exists.
If you do not want to to return the previous value during these states, use ref.watch(provider).unwrapPrevious().valueOrNull as stated in the comment.
Ah okay thanks @snapsl I read the comment wrong. I thought both of those lines pertained to value, but the last line is talking about the example in the code block.
Looking at the comments for
AsyncValue.value
says both "It will return the previous value during loading/error state" and "This will return null during loading/error states". These seem contradictory.https://github.com/rrousselGit/riverpod/blob/11244e40a380147d1823ad6efc61b6cc3ec84d4b/packages/riverpod/lib/src/common.dart#L183C3-L194C57
The text was updated successfully, but these errors were encountered: