Stylianos Gakis
10/21/2024, 1:54 PM@Stable
internal interface MyStateHolder<T> {
val value: T
fun operateOnTheStateHolder(newValue: Input)
}
And I then create a fun
to create an instance of it, smth like:
fun <T> MyStateHolder(
someInput: T
): MyStateHolder<T> = object : MyStateHolder {
override var value: T by mutableStateOf(someInput)
private set
override operateOnTheStateHolder(newValue: Input) {
...
}
}
Is this enough for me to still be able to create an instance of it and still have it be stable properly?
Or must I create a data class
which implements my interface in order for it to have the equals/hashCode methods implemented? (Or without data
and do it myself)?Stylianos Gakis
10/21/2024, 2:05 PMabstract class PagerState
too https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]idx/compose/foundation/pager/PagerState.kt;l=148?q=PagerStateZach Klippenstein (he/him) [MOD]
10/21/2024, 5:06 PM@Stable
, and that's the type used in the composable function signatures, then the compiler will treat it as stable no matter what the implementation isZach Klippenstein (he/him) [MOD]
10/21/2024, 5:07 PMStylianos Gakis
10/21/2024, 5:29 PMZach Klippenstein (he/him) [MOD]
10/21/2024, 6:23 PM