Skip to content

Instantly share code, notes, and snippets.

@codingjeremy
Last active April 13, 2023 17:41
Show Gist options
  • Save codingjeremy/e2bd9868dcd4656f3b129b70aae07cb8 to your computer and use it in GitHub Desktop.
Save codingjeremy/e2bd9868dcd4656f3b129b70aae07cb8 to your computer and use it in GitHub Desktop.
How code executes before the improvement to Compose's Pointer Input.
/* Copyright 2023 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
Box(Modifier
.fillMaxSize()
.pointerInput(Unit) {
awaitPointerEventScope { //<-- Executes
while (true) { //<-- Executes
val event = awaitPointerEvent() //<-- Suspends
// Do something with the event.
}
}
}
) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment