yschimke
10/01/2021, 11:37 AMyschimke
10/01/2021, 11:42 AMCsaba Kozák
10/01/2021, 1:45 PMmutableStateOf()
in a ViewModel. Compose specific code should not leak into VMs. StateFlow
is a better fit there.Csaba Kozák
10/01/2021, 1:48 PMmyanmarking
10/01/2021, 2:21 PMCsaba Kozák
10/01/2021, 2:23 PMAdam Powell
10/02/2021, 4:02 PMmutableStateOf
. Yes, in ViewModels too. Snapshots are not a UI or Compose-specific technology, it's a generic observable MVCC system.Adam Powell
10/02/2021, 4:08 PMCsaba Szugyiczki
10/04/2021, 11:00 AMAdam Powell
10/04/2021, 1:50 PMMutableStateFlow
those are hot data sources) then doing any sort of lifecycle-bound collect isn't buying you much, if anything. Whatever process is changing the MutableStateFlow in response to other external stimuli is still running in the background unless you have some different means of limiting it.Csaba Szugyiczki
10/04/2021, 2:08 PMAdam Powell
10/04/2021, 2:10 PMclass MyViewModel : ViewModel() {
var myValue by mutableStateOf(initial)
private set // optional
}
Archie
10/19/2021, 3:44 PMmutableStateOf
inside the ViewModel. Is this assumption correct?