I expanded upon the Bonus Section with this sample gist in order to make the code more concise using Kotlin’s scoping functions. The final error data is created by concatenating any error messages from either LiveData result.

Thanks for the simple MediatorLiveData sample above Jose Alcérreca! This helped me clean up how content is passed to the views in Coinverse, by passing one complete data object, instead of observing many.

--

--

Open Sourcer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store