Last active
September 28, 2020 02:36
-
-
Save JoseAlcerreca/97ab91e056351fdb61fe59e8e8bcc269 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
class ListViewModel : ViewModel { | |
private val _navigateToDetails = MutableLiveData<Event<String>>() | |
val navigateToDetails : LiveData<Event<String>> | |
get() = _navigateToDetails | |
fun userClicksOnButton(itemId: String) { | |
_navigateToDetails.value = Event(itemId) // Trigger the event by setting a new Event as a new value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment