Pablo
03/06/2025, 7:01 PMval stateHolder = remember { MyState() }
and
val stateHolder by remember { mutableStateOf(MyState()) }
Checking nowinandroid sample, they use a NiaAppState that they declare using the first way, without mutableStateOf. Supposedly, mutableStateOf is necessary to listen to changes in variables, so, why not using it?Pablo
03/06/2025, 7:05 PM@Stable
class MyState{
var currentStep by mutableStateOf(Step.ARE_YOU_SATISFIED)
private set
fun updateCurrentStep(value: Step) {
currentStep = value
}
}
Pablo
03/06/2025, 7:06 PMAlexandru Caraus
03/06/2025, 7:44 PMAlexandru Caraus
03/06/2025, 7:46 PMStylianos Gakis
03/06/2025, 7:58 PM