Engrain by ByteRush

WEB.03.04 Mid-level

Custom events and passive listeners

Comes up in: Web fundamentals

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • CustomEvent with detail
  • dispatchEvent is synchronous
  • passive listeners for touch/wheel scroll performance
  • EventTarget as a base class

Words you will know

custom eventpassive listener

What you will practise

  • component communication via custom events

Interview questions this answers

  • What is a passive event listener and why does it help scrolling?
  • Is dispatchEvent synchronous or asynchronous?