Intermediate
Kotlin
Q51 / 100
What is the difference between StateFlow and SharedFlow?
Correct! Well done.
Incorrect.
The correct answer is B) StateFlow holds a current value and replays it to new collectors; SharedFlow is configurable and doesn't require a current value
B
Correct Answer
StateFlow holds a current value and replays it to new collectors; SharedFlow is configurable and doesn't require a current value
Explanation
StateFlow is like LiveData — it always has a value and emits updates. SharedFlow is more flexible with configurable replay, buffer, and overflow strategies.
Progress
51/100