Created
September 22, 2020 14:25
Star
You must be signed in to star a gist
Flow incrementador
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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