← App contract

app.handle

app/main
app.handle(action: string, target: string, value: string)

Receives admitted UI and host events before the next render.

When to use it

Implement handle when the application reacts to controls, input, timers, navigation, lifecycle, media state, or other admitted host events.

Parameters

ParameterType / valuesDescription
actionstringAn onTap/onInput/onDismiss action or a host event such as lifecycle, timer, history, open_url, system_back, or media_state.
targetstringThe stable component ID or host target such as app or browser.
valuestringThe committed input value or bounded event payload; it may be empty.

Returns

Nothing. State changes become visible in the render that follows the handler.

Focused example

local function handle(
    action: string,
    target: string,
    value: string
)
    -- Validate the event and update module state.
end

Complete inventory

View all pages in App contract
← Previous: app.renderNext: app.resolve →