Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Created September 22, 2020 14:25
Show Gist options
  • Save jaozinfs/9fa5cc920fdacfb246a192cad8d6bbc9 to your computer and use it in GitHub Desktop.
Save jaozinfs/9fa5cc920fdacfb246a192cad8d6bbc9 to your computer and use it in GitHub Desktop.
Flow incrementador
suspend fun increase(delay: Long):Flow<Int> = flow {
var start = 0
do {
emit(start)
delay(delay)
start++
} while (coroutineContext.isActive)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment