Created
July 23, 2019 12:53
-
-
Save akshaybhange/ead54823ef9f786f1ac35035fb73b657 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productData = MediatorLiveData<Resource<Product>>() | |
init { | |
fetchData() | |
} | |
fun fetchData() { | |
productData.addSource(productRepository.getproduct(id)) { | |
productData.value = it | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment