Well, LiveData and StateFlow may be considered as synonyms except that all Flows are primarily Kotlin stuff, and LiveData is a part of AndroidX
SharedFlow is an unstoppable flow
LiveData and StateFlow are both holding one value (aka State) per time
But for StateFlow, it's mandatory to have initial state, but not for LiveData
SharedFlow should be used when you deal with endless flow of data
Обсуждают сегодня