is there any way to handle the nullability of the ...
# rx
m
is there any way to handle the nullability of the api response, I tried to use default values in the model, but not sure Retrofit use them in parsing the model to Rx
p
This is a perfect example of how you can make great spaghetti using rx. This should return a single and the whole logic can be done in a simple
map
.
m
where is the spaghetti, could you point it out
p
Imo all these operator chaining makes it very hard to follow the logic flow
The toObservable things make it even more complicated. Also the firstOrError()->onErrorResumeNext is complicated because it builds the control flow based on exceptions
Also a function named
build
and a string called
params
doesn't let me know what's happening here
From the code I'd say it should be called
phoneNumberOfPrimaryDeliveryCourier
and maybe even return a
PhoneNumber
class
m
I agree with some things, maybe the multiple map operators could be one but still you will need to check for the Nullablity which was my first question.
p
But the nullability of what?
m
backend response retrieve Nulls
p
Didn't show my refactoring how to handle null?
👍 1