Created
November 12, 2024 15:49
-
-
Save anitaa1990/04b366dc39976ed66dd52f97888708bc 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
// Presentation Layer (ViewModel) calls a Use Case | |
class ProfileViewModel(private val getUserProfile: GetUserProfile) : ViewModel() { | |
val userProfile = MutableLiveData<User>() | |
fun loadProfile(userId: String) { | |
viewModelScope.launch { | |
val result = getUserProfile(userId) | |
userProfile.value = result | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment