other than having to write a bit more and having u...
# compose
m
other than having to write a bit more and having ugly setters, is there any reason to not use
MutableStateFlow
instead of Compose's
MutableState
in state holder classes? I don't mean just
ViewModel
, but small classes for specific components too. Is it just a matter of taste/thread safety?
p
I think is protection against accidental calls to
update{}
from the Composable side.
m
from what I'm experiencing you should pick one or the other if you have the choice because otherwise you end up with weird situations like not being able to take advantage of flow's
combine
or mutable state's
derivedStateOf
without ugly hacks (within state holder classes)
p
I have seen some people exposing the MutableStateFlow directly and they live happy with that.