riverpod
riverpod copied to clipboard
AsyncError.value should return null instead of throwing
And valueOrNull should be removed
This is to better support pattern matching, as folks are bound to mistakenly use value instead of valueOrNull
Currently when someone uses AsyncValue.value the error recovery is poor sometimes if valueOrNull should have been used. (the value was null at runtime) Will the removal of valueOrNull from AsyncValue/AsyncError fix this?
I'm not exactly sure what you're referring to. But if "valueOrNull" should've been used instead of "value", then yes.
This issue is effectively about deleting the old value and renaming valueOrNull -> value.
That was indeed what I was implying yes.
Was implemented in the dev branch