https://kt.academy/article/sharedflow_vs_stateflow
StateFlow and SharedFlow seem similar, but they are designed for different use cases, and they should not be confused. Let’s discuss the key differences and usages.
Let’s start with how they work. SharedFlow resembles a broadcast channel—emitted values are delivered to all observers. It allows setting a replay parameter specifying how many past values should be emitted to new observers.