Daniel Okanin

07/08/2022, 4:44 PM
Hello! I’m trying to help the compose compiler to mark the model as stable (because I have performance issue). So I have ImageDesctiptor - interface model that exists in module doesn’t run compose so I wrap the class in that way/ Where Im wrong?
data class ImmutableHolder<T>(val item: T)

and I see that metrics:
unstable class PhotoViewModelItem {
  unstable val imageDescriptor: ImmutableHolder<ImageDescriptor>?
  stable val isSaved: MutableState<Boolean>
  stable val photoType: PhotoType?
  stable val tagsCount: Int
  <runtime stability> = Unstable
runtime class ImmutableHolder {
  runtime val item: T
  <runtime stability> = Parameter(T)


07/12/2022, 10:14 AM
Marking as Stable should do it