-
A unit result has no value for the success case, but has an error for the failed case. How does that differ to using a plain |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Was there a real need to introduce |
Beta Was this translation helpful? Give feedback.
-
I agree. I'm not sure if there was a 100% need for that, the topic itself is arguable. But in my projects, I just use |
Beta Was this translation helpful? Give feedback.
Result
is a shortcut forResult<Unit, string>
, whereasUnitResult
is a shortcut forResult<Unit, T>
. The difference is that inUnitResult
the error type may vary, whereas inResult
it's set tostring
. See also this discussion: #321