You are reading the docs for 0.9. The latest version is 0.10. Read this page for 0.10 →

Emit<EM extends EventMapBase>

type
types.ts:355

Emits an event.

**Channel and type are joined into one key, "channel::type",** and dispatch, deduplication and introspection all key on it. So two different pairs can collapse together: ("a::b", "c") and ("a", "b::c") both become "a::b::c", and a subscriber registered for one is invoked for the other, while a dedup window lets one drop the other. A :: in a channel is fine on its own, it is how a peer's channel is namespaced, so development builds warn on the **collision**, naming both pairs, rather than on the separator. Nothing throws.

Definition

type
type Emit<EM extends EventMapBase> = (channel: C, type: T, payload: EM[C][T], opts?: EmitOptions) => Promise<EmitResult>

(channel: C, type: T, payload: EM[C][T], opts?: EmitOptions) => Promise<EmitResult>

Type parameters

NameTypeDescription
EMextends EventMapBase