Guilherme Delgado
02/23/2022, 12:57 PMfun <STATE : Parcelable, SIDE_EFFECT : Any> ViewModel.container(...)
Why forcing kotlinx.parcelize.Parcelize
when we could also use kotlinx.serialization.Serializable
? 🤔
According to the docs if we want to store something in disk, Serializable would be preferable, where Parcelize would be the choice for IPC situations. SaveStateHandle also supports Serializable
What do you think about adding an extension that receives as STATE: Serializable
?Mikolaj Leszczynski
02/23/2022, 1:08 PMGuilherme Delgado
02/23/2022, 1:16 PMGuilherme Delgado
02/23/2022, 1:17 PMappmattus
02/23/2022, 1:28 PMappmattus
02/23/2022, 1:51 PMGuilherme Delgado
02/23/2022, 3:23 PMType is not directly supported by ‘Parcelize’. Annotate the parameter type with ‘@RawValue’ if you want it to be serialized using ‘writeValue()’