Skip to content

Instantly share code, notes, and snippets.

@walnashgit
Created May 8, 2021 06:29
Show Gist options
  • Save walnashgit/e79d69ff065977b1fbb48cd13ed15b0a to your computer and use it in GitHub Desktop.
Save walnashgit/e79d69ff065977b1fbb48cd13ed15b0a to your computer and use it in GitHub Desktop.
class MainViewModel : ViewModel() {
......
private val _clickCount = MutableLiveData(0)
val clickCount: LiveData<Int> = _clickCount
fun updateClick(value: Int) {
_clickCount.value = value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment