🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

listSaver

The Saver implementation which allows to represent your Original class as a list of Saveable values.

ListSaverSample

@Sampled
@Composable
fun ListSaverSample() {
    data class Size(val x: Int, val y: Int)

    val sizeSaver =
        listSaver<Size, Int>(save = { listOf(it.x, it.y) }, restore = { Size(it[0], it[1]) })
}

Content updated: