SendData

fun EventSchemaBuilderScope.SendData(id: String = randomId(), trigger: EventTrigger, events: EventSchemaBuilderScope.() -> Unit = {}, dataKey: String, data: AnySerializable? = null)

Posts a value into the client's DataMailer under dataKey, where a later CheckForReceivedData can pick it up — the mailer is a one-shot channel, so this is how a value is handed off to another screen. Sends data when it is non-null, otherwise incomingData. Dispatches onSuccess (no data) after the value is posted; onFailure (no data, error logged) when both data and incomingData are null, so there is nothing to send.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

events

Child events chained after this one, wired to its triggers (onSuccess, onFailure).

dataKey

Mailer key the value is posted under, read by a matching CheckForReceivedData.

data

Literal value to send. Defaults to none (sends incomingData instead).