Subscribe to an event on the bus. The payload type is inferred from evt.
evt
The event name (a key of EventMap).
Handler that receives the event payload.
A function that cancels the subscription. Call it on teardown.
import { on } from "@urth/metatell-sdk/events";const off = on("chat:message", (m) => console.log(m.text)); Copy
import { on } from "@urth/metatell-sdk/events";const off = on("chat:message", (m) => console.log(m.text));
Subscribe to an event on the bus. The payload type is inferred from
evt.