I have a composables-ui only module where we build out our teams specific components. We're just getting started, but I have a question on a composable that we want to have a specific enum.
Simple question I suppose, but nothing wrong with this impl? Should the enum be annotated with stable or anything like that, or any considerations for having the enum definition in the composables-ui module?
MyDesignSystemComponents.kt
Copy code
enum class Factor {
Classy, Lossy, None
}
@Composable
fun FactorUi(factor: Factor) {
👌 2
v
Valentin Gusselnikov
05/03/2023, 5:57 PM
Our team would prefer to slap
@Immutable
on it, so that later when for some reason we are going to change this
enum class
, we would see that it has
@Immutable
annotation, meaning if we want to change it we should comply with
@Immutable
requirements.
It's a kind of communication with yourself in the future and with your teammates. Nothing changes in terms of performance