Skip to content

Instantly share code, notes, and snippets.

@krzdabrowski
Created August 10, 2022 16:19
  • 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 krzdabrowski/c9494004a81d9b9358ca742c38e3086e to your computer and use it in GitHub Desktop.
@Composable
private fun HandleEvents(events: Flow<RocketsEvent>) {
val uriHandler = LocalUriHandler.current
events.collectWithLifecycle {
when (it) {
is OpenWebBrowserWithDetails -> {
uriHandler.openUri(it.uri)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment