Dispatch Expressions
A DISPATCH expression emits an event to a value. It is used to drive the outside world — for example, to fire a click or input event on a browser element.
DISPATCH is performed for its effect, not its value: it runs synchronously and always evaluates to NONE.
Payload and options
The WITH clause attaches a payload to the event, and the OPTIONS clause carries settings that describe how the event should be emitted.
The event name can be a literal string, a variable, or a bind parameter.
Arrow shorthand
For an event with no payload or options, the arrow operator <- is a concise alternative. The target is on the left and the event name on the right.
The two forms are equivalent. Like the long form, the shorthand evaluates to NONE, so it can appear anywhere an expression is allowed — including inside a MATCH arm or a function body.
A host capability
DISPATCH only works when the target value can receive events — it must be a dispatchable value provided by a module or the host application, such as a browser element. Dispatching to a value that does not support it fails at runtime. See Value Capabilities and Host Values.
To wait for events instead of emitting them, see Waitfor Expressions.