serializationSaver
@ExperimentalSerializationApi
Create an AtomSaver for Kotlin Serialization.
Usage:
@Serializable
data class CounterData(
val value: Int = 0
)
@OptIn(ExperimentalSerializationApi::class)
private val counterAtom = atom(CounterData(), saver = serializationSaver("counter"))
Content copied to clipboard
Return
The AtomSaver for the value.
Parameters
T
The type of the value to save and restore.
key
The key to be used to save and restore the value.
serializer
The serializer to use for the value.
bundler
The bundler to encode and decode the value. Default is Bundler.