Gil Goldzweig
05/28/2019, 5:25 AMmatvei
05/28/2019, 6:46 PM@Composable
fun UserRow(userId: Int) {
    val user = +state<User?> { null }
    +onActive {
        val dispose = Api.getUserAsync(userId) { user.value = it }
        onDispose { dispose() }
    }
    if (user.value == null) {
        LoadingIndicator()
    } else {
        Row {
            Image(src = user.value.profileImage)
            Text(text = user.value.name)
        }
    }
}matvei
05/28/2019, 6:51 PMfun LoggedText(text: string) {
    +onDispose { Log.i(TAG, "text leaves composition") }
    Text(text)
}matvei
05/28/2019, 6:53 PMmatvei
05/28/2019, 6:57 PMGil Goldzweig
05/29/2019, 3:22 AM