Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private fun provideCurrencyUpdateFlow(): Flow<Int> {
return flow {
repeat(10000) {
delay(Random.nextLong(500L, 2500L))
emit(Random.nextInt(0, 100))
}
}.flowOn(Dispatchers.Default).distinctUntilChanged()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment