Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Last active April 18, 2021 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Skyyo/9f52a7a5661fbcd7a1437dfb2b4e95d2 to your computer and use it in GitHub Desktop.
Save Skyyo/9f52a7a5661fbcd7a1437dfb2b4e95d2 to your computer and use it in GitHub Desktop.
fun onCardActive(currencyId: Int, index: Int) {
if (producers.containsKey(currencyId)) return
val currencyPriceUpdateFlow: Flow<Int> = provideCurrencyUpdateFlow()
val currencyPriceUpdateJob = viewModelScope.launch {
observePriceUpdateFlow(index, currencyPriceUpdateFlow)
}
producers[currencyId] = currencyPriceUpdateJob
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment