Does this count as a "hot" flow if it isn't starte...
# coroutines
c
Does this count as a "hot" flow if it isn't started unless there is at least 1 subscriber?
Copy code
val pokemonInfo: StateFlow<PokemonInfo?> =
  pokemon.filterNotNull().flatMapLatest { pokemon ->
    detailsRepository.fetchPokemonInfo(
      ..
    )
  }.stateIn(
    scope = viewModelScope,
    started = SharingStarted.WhileSubscribed(5_000),
    initialValue = null,
  )
Got the snippet form this article for context: https://proandroiddev.com/loading-initial-data-in-launchedeffect-vs-viewmodel-f1747c20ce62
s
If a flow/observable is not active when no observer is subscribed (your situation), it's a cold flow. A hot flow is active, emits values, even when no one is listening/subscribed.
👍 1