Skip to content

Instantly share code, notes, and snippets.

@AndroidPoet
Created October 14, 2022 02:04
Show Gist options
  • Save AndroidPoet/54300600e32d04cb4fa2fc66565ea272 to your computer and use it in GitHub Desktop.
Save AndroidPoet/54300600e32d04cb4fa2fc66565ea272 to your computer and use it in GitHub Desktop.
@Composable
fun DemoCoroutineScope() {
val scope = rememberCoroutineScope()
Button(onClick = {
scope.launch {
//CoroutineScope
//run any suspend functions inside this scope
}
}) {
Text(text = "I can execute suspend functions")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment