Great reply from Viktor, I would just add that if you want exactly the same behavior as LiveData (to pause observing event onStop and resume onStart), use
flowWithLifecycle
Also not necessary StateFlow, which always has value (as LiveData), but Flow too, it's actually more flexible API than LiveData