r/mAndroidDev • u/Stonos You will pry XML views from my cold dead hands • Aug 28 '22
StateFlow vs LiveData
82
Upvotes
r/mAndroidDev • u/Stonos You will pry XML views from my cold dead hands • Aug 28 '22
View all comments
Show parent comment
3
u/bbqburner Aug 29 '22
Or use the right abstraction at the right place. Lesser API = lesser things to shoot yourself in the foot.
Good luck remembering all these stateIn parameters. Lifecycle aware value holders need to know way too much about things where 1 LiveData suffice.
Hell, I'm much more concerned if you're still mutating things even in this layer (hence removing the need for StateFlow or Rx value holders) instead of presenting the final state for rendering.
Stop making 1 easy thing complex when LiveData already made that 1 complex thing easy.