Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Kotlin
Kotlinhard

StateFlow vs SharedFlow — what’s the practical difference?

Tags
#stateflow#sharedflow#flow#hot-streams
Back to categoryPractice quiz

Answer

StateFlow always has a current value and replays the latest to new collectors (state). SharedFlow is a more general hot stream: you can configure replay/buffer and use it for events. Use StateFlow for UI state and SharedFlow for one-off events.

Related questions

Kotlin
StateFlow vs SharedFlow: what’s the difference?
#kotlin#stateflow#sharedflow
Kotlin
Channel vs Flow - how are they different in coroutines?
#kotlin#coroutines#flow
Kotlin
Flow vs Sequence — what’s the key difference?
#flow#sequence#streams