action

Functions summary

Action
@Composable
action(key: String?, block: () -> Unit)

Create an Action that runs block when triggered.

Functions

action

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

Create an Action that runs block when triggered.

Parameters
key: String? = null

A stable and unique key that identifies this action. This key is saved in the PendingIntent for the UI element, and used to trigger this action when the element is clicked. If not provided we use currentCompositeKeyHash as the key. Since that key is based on the location within the composition, it will be identical for lambdas generated in a loop (if not using androidx.compose.runtime.key). To avoid this, prefer setting explicit keys for your lambdas.

block: () -> Unit

the function to be run when this action is triggered.