Skip to content

Instantly share code, notes, and snippets.

@sanogueralorenzo
Created March 22, 2018 23:01
Show Gist options
  • Save sanogueralorenzo/0e4dcc85131f5ba4fae8c7e80171c5f4 to your computer and use it in GitHub Desktop.
Save sanogueralorenzo/0e4dcc85131f5ba4fae8c7e80171c5f4 to your computer and use it in GitHub Desktop.
class CounterViewModel : ViewModel() {
val counter = MutableLiveData<Int>()
var number = 0
fun onButtonClick() = counter.setValue(++number)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment