Events and Messaging in JavaScript
summary
Covers concrete DOM behavior (addEventListener vs attachEvent), shows that non-bubbling events can still be captured, and explains capture vs bubble order and stopImmediatePropagation’s effect on same-element handlers. Demonstrates event delegation with matches and fallbacks, then refactors a jQuery video-search into components that emit events (example: search.requested with term payload), uses Backbone/Angular patterns, and recommends Monologue, Postal or Amplify for a message bus so components stay testable, reusable and decoupled.
AI-written summary · about
chapters (12)
- 0:00Introduction and overview
- 1:16Understanding events
- 3:44Deep dive into DOM events
- 6:48Capturing and bubbling
- 8:21Advanced event propagation
- 13:00Implementing event delegation
- 17:54Debugging and best practices
- 21:52The Observer pattern
- 25:40Building an example app
- 31:16Designing component APIs
- 37:38Refactoring with components
- 41:30Message bus and conclusion
