liveBook · Manning

Event type

As explained in Web Components in Action

An event type is a string identifier that distinguishes the kind of event delivered through an event system.

An event type is a string identifier that tells an event system what kind of event is being delivered. In an event bus or the DOM, listeners use this value to receive matching events. section 14.6

Choose names specific enough to remain unique as an application grows. A generic name such as change or onUpdate can collide with native DOM events or other custom events; broader names can still be appropriate when the distinction does not matter. section 14.6

How Web Components in Action covers it

How deep it goes
Defines event types as strings, explains naming collisions, and demonstrates shared constants without descending into event-system internals.
Examples
Uses a workout player's onPlaylistTimeUpdate listener and a workout plan's dispatched CustomEvent with timing details.
What it assumes
Assumes basic familiarity with DOM events, listeners, event buses, and JavaScript classes.
What you can do after
Apply event types via an event bus and CustomEvent, including reusable static getters for shared names.
How it connects
Connects event types with event buses, DOM events, CustomEvent, event listeners, and event payloads.

Also explained in

Compare how 2 books explain event type →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.