Skip to content

Instantly share code, notes, and snippets.

@KhomDrake
Last active March 20, 2022 23:16
Show Gist options
  • Save KhomDrake/63081fc735466e28a9d6d7ac70f9f027 to your computer and use it in GitHub Desktop.
Save KhomDrake/63081fc735466e28a9d6d7ac70f9f027 to your computer and use it in GitHub Desktop.
suspend fun setupMovies(completion: Continuation<Any?>) {
when(label) {
0 -> {
val token = makeLogin("someValue", "someValue")
}
1 -> {
val movies = loadMovies(token)
}
2 -> {
printMovies(movies)
}
3 -> {
completion.resume(Unit)
}
else -> throw IllegalStateException(...)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment