AceMobileInterview

← Android track

General topic questions

StateFlow vs SharedFlow

MediumCommon

Free section · general topics & algorithms

When StateFlow vs SharedFlow?

Reveal model answer
StateFlow holds latest value (state). SharedFlow is event stream (one-off effects) with replay/buffer config. Don’t use StateFlow for transient events.
← RepeatOnLifecycleFlow vs LiveData →