More a design question, but do you wrap all your e...
# rx
g
More a design question, but do you wrap all your events in
Result
class? In Repository as well? I see this idea popping up here and there and I just feel like it's a useless noise. There is a case when you woudn't want to break the stream on error (in UI layer, for example), but then I'd just catch the error and emit a special type of item. I'd rather do this, then wrap/unwrap the
Result
everywhere. Seems like google's influence with its primitive
LiveData
with no error handling support, where you have no choice other than adding exceptions to the data itself.
c
I use it so I can emit loading states until the successful one, and know the source of each retrieved data. But im quite new in this so idk if its a nice approeach
I don't see the point in having an onSuccess that you must check if its an error if you already have an onError