Slide 6
Slide 6 text
@Composable
fun Counter(store: SelfStore) {
val amount = +state { 0 }
MaterialTheme {
Column {
Text(text = "Counter demo '${store.text}'")
Button(text = "Add", onClick = { amount.value++ })
Button(text = "Subtract", onClick = { amount.value-- })
Text(text = "Clicks: ${amount.value}")
}
}
}