Function

Saver

The [Saver] describes how the object of [Original] class can be simplified and converted into something which is [Saveable].

CustomSaverSample

@Composable
fun CustomSaverSample() {
    data class Holder(var value: Int)
    // this Saver implementation converts Holder object which we don't know how to save
    // to Int which we can save
    val HolderSaver = Saver<Holder, Int>(save = { it.value }, restore = { Holder(it) })
}