action

Composable Function

Android
@Composable
fun action(
    key: String? = null,
    block: () -> Unit,
): Action

Create an Action that runs block when triggered.

that is automatically generated by the Compose runtime which is unique for every exact code location in the composition tree.

Parameters

keyAn optional key to be used as a key for the action. If not provided we use the key
blockthe function to be run when this action is triggered.