Last active
May 19, 2020 03:44
-
-
Save tsuijten/08ec47fe661faccd52da06736ddd52bf 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
@Composable | |
fun MyApp() { | |
MaterialTheme { Counter() } | |
} | |
@Composable | |
fun Counter() { | |
val amount = +state { 0 } | |
Column { | |
Text(text = "Counter demo") | |
Button(text = "Add", onClick = { amount.value++ }) | |
Button(text = "Subtract", onClick = { amount.value-- }) | |
Text(text = "Clicks: ${amount.value}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment