Hello! I’m trying to help the compose compiler to...
# compose
d
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?
Copy code
@Immutable
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)
}
m
Marking as Stable should do it