Hey! Needed some help. Is there a way I can get a ...
# rx
g
Hey! Needed some help. Is there a way I can get a value out of a
single
if it is empty? For example, I have my DB call returning a single and want to return a boolean value on basis of whether it is empty or not. I'm doing the following currently, but it doesn't seem to work as the control gets blocked (as the table is empty).
Copy code
myDao
    .getAll(object.id())
    .isEmpty
    .blockingGet()
    .not()
l
Single itself doesn’t have a concept of an empty value. It should either emit a value or an error.
getAll
is implemented by you?
That snippet should work if
getAll
is a correctly implemented Flowable/Observable