AsyncValue.guard error 'side effect' #794
Unanswered
josh-burton
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You can alternatively do: if (myAsyncValue is AsyncError)
Fimber.e("Failed to load data", ex: myAsyncValue.error);
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like AsyncValue.guard for it's simplicity in constructing an AsyncValue from a future, but I find myself needing a callback if there was an error so I can log the error to crash reporting etc.
Currently after the guard I'm doing this:
I think this works ok but it doesn't quite feel right. Maybe a
myAsyncValue.whenError()
function would feel more natural.Beta Was this translation helpful? Give feedback.
All reactions