kite-core / jp.co.cyberagent.kite.core / subscribe
subscribe¶
fun
KiteDslScope
.subscribe(action:
KiteSubscribeScope
.() ->
Unit
):
Unit
Run the action during the action.
Usage:¶
val myState = state { 0 }
launch {
for(i in 0..10) {
delay(1000)
myState.value++
}
}
subscribe {
// text will changed with 0, 1, 2, ..., 10
textView.text = myState.value.toString()
}