@Mehdi Maybe adding a loading state to that result would be a good idea
g
ghedeon
01/16/2019, 12:27 PM
I've seen it in some Google examples, questionable decision tho. What if you combine different results? What's loading and what not? Why do you need it in a first place? On ui level you'll always know when it's loading. It's when you asked for data and didn't receive it yet.
c
Caner Korkmaz
01/16/2019, 12:28 PM
Yeah, I usually don't add loading and treat the Result<T> as Either<X, S>. However, it is a design decision, and some consider it more useful to have a loading state, especially if they don't use the result in a functional style.