← App contract

app.resolve

app/main
app.resolve(id: number, success: boolean, payload: string, code: string, message: string)

Receives the bounded completion of an asynchronous Host, Server, or Media request.

When to use it

Implement resolve when the application starts asynchronous Host, Server, or Media operations and must correlate their results by RequestId.

Parameters

ParameterType / valuesDescription
idnumberThe RequestId returned when the operation started.
successbooleanWhether the operation completed successfully.
payloadstringThe successful bounded payload, or an empty string after failure.
codestringThe stable failure code, or an empty string after success.
messagestringThe bounded diagnostic message, or an empty string after success.

Returns

Nothing. Clear the matching pending operation and update state for the following render.

Focused example

local function resolve(
    id: number,
    success: boolean,
    payload: string,
    code: string,
    message: string
)
    -- Match id, clear pending work, then update state.
end

Complete inventory

View all pages in App contract
← Previous: app.handle