https://kotlinlang.org logo
#compose
Title
# compose
c

cuongtd

06/02/2021, 4:02 AM
assume I have this code :
Copy code
@Composable
fun ExampleList() {
    val items by ExampleViewModel.items.observeAsState()

    LazyColumn(
        modifier = Modifier
            .fillMaxSize().padding(horizontal = 15.dp)
    ) {
        items(items = items) { item ->
            ExampleItem(item)
        }
    }
}

@Composable
fun ExampleItem(item: Item) {
    Text(text= item.value)
}
is there anyway to get previous value of item in ExampleItem Compose everytime item is updated?