Created
November 15, 2019 17:41
-
-
Save gastsail/dadb9d1bfbeb2bdee0c2ec2b54a41d2f to your computer and use it in GitHub Desktop.
MainViewModel
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
class MainViewModel(private val useCase: UserUseCase) : ViewModel() { | |
fun retrieveUserData(userId:String):LiveData<Resource<String>> { | |
val userData = MutableLiveData<Resource<String>>() | |
useCase.retrieveUserData(userId).observeForever { | |
userData.postValue(it) | |
} | |
return userData | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment