Created
March 22, 2018 23:01
-
-
Save sanogueralorenzo/0e4dcc85131f5ba4fae8c7e80171c5f4 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 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