Classifies one received event by its type alone, before any payload is looked at.
type
One item of EventPage.events or a gateway dispatch, as received.
EventPage.events
{ kind: "known", event } for a type in KNOWN_EVENT_TYPES, otherwise an UnknownEvent; never a known type for an event of another type, even when its payload would fit.
{ kind: "known", event }
const decoded = decodeEvent(item);if (decoded.kind === "known" && decoded.event.type === "thread.updated") { show(decoded.event.payload.thread);} Copy
const decoded = decodeEvent(item);if (decoded.kind === "known" && decoded.event.type === "thread.updated") { show(decoded.event.payload.thread);}
Classifies one received event by its
typealone, before any payload is looked at.