Types
Event
Event type {
type: Str,
data: Any
}
Functions
send core
fn (event: Event)
fn (event-type: Str, event-data: Any)
Publish an event with event-type and event-data. Handlers listening for this event type will be invoked.
Example
// Publish a user creation event
send("user:created", {"id": "123", "email": "alice@example.com"})
// Handler that responds to this event (in another file)
// on-user-created meta {"on-event": "user:created"}
// fn (event) { send-welcome-email(event.data.email) }