Skip to content

Creating a Shared Flow with Shared‐In

Devrath edited this page Jan 21, 2024 · 4 revisions

How the SharedIn operator is useful

Using the SharedIn operator, We can convert the cold flow into a hot flow!

3 ways of converting to hot flow using shared-in

  • Eagerly -> Emission will start even if no subscribers are there
  • Lazily --> Emission will start on for first subscribers
  • WhileSubscribed -> Emission will start when there are subscribers and end when there are no subscribers

Clone this wiki locally