Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Created September 22, 2020 14:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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