how do I convert `MutableLiveData` to `Observable`...
# android
i
how do I convert
MutableLiveData
to
Observable
?
a
What is the use case for this? Technically there is not a 100% accurate way to do this conversion since livedata sends its updates to lifecycleowners which observable is not. A lifecycle owner could update the observable based on the livedata changes as a sort of workaround to this but I can't think of a case where this would be needed.
i
someone configured validation inputs in view model as live data, e.g. email, name, password...
each has a live data, which is wired to the UI via data binding...
now I want to process / validate these inputs, but this is kinda business logic so I want to do it with rx
thus I need live data -> rx conversion
I guess I can change the live data inputs if needed to something else, not sure what
a
i
medium... can't read, article limit 🙂
g
a
@iex Just use incognito
i
@aoriani oh lol, I opened it in a different browser, thinking that it would react to the missing cookies but it didn't work? incognito works
thanks
ok, I checked it out, but I really would like to use rx and not live data to perform the validation. Have a bit more complex flow in mind and it becomes very unwieldy with live data
c
The conversion between the two is not optimal. I had problems with livedata being subscribed for ever. You could subscribe to a livedata en then emit it in a publisher perhaps ? But that all sounds pretty bad
i
so should I just ditch live data for inputs?
and leave it for view model -> ui only?