ProvideActionInterceptor

Functions summary

Unit
@Composable
A2uiComponentScope.ProvideActionInterceptor(
    onIntercept: (actionPayload: Map<StringAny?>) -> Boolean,
    content: @Composable () -> Unit
)

Intercepts actions dispatched by descendant components within content.

Functions

A2uiComponentScope.ProvideActionInterceptor

@Composable
fun A2uiComponentScope.ProvideActionInterceptor(
    onIntercept: (actionPayload: Map<StringAny?>) -> Boolean,
    content: @Composable () -> Unit
): Unit

Intercepts actions dispatched by descendant components within content.

Useful for container components (such as modals) that handle actions from child triggers (like buttons or cards) to update local UI state instead of dispatching to the surface.

Interceptor Chaining

Interceptors chain from the innermost (deepest child) to the outermost (ancestor) in the composition tree:

  • If onIntercept returns true, the action is consumed immediately; outer interceptors and the underlying surface will not receive the action.

  • If onIntercept returns false, the action falls back to the parent interceptor.

  • If all chained interceptors return false, the action dispatches to the surface.

Parameters
onIntercept: (actionPayload: Map<StringAny?>) -> Boolean

The callback invoked when a descendant dispatches an action. Return true to consume the action, or false to pass it to parent interceptors or the surface.

content: @Composable () -> Unit

The composable content to apply the interceptor to