Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
How do browsers handle DOM events during blocking operations?

For instance, we have function reallyHeavyOperation, that blocks javascript thread for some time. And, during this operation execution, user clicks a button with a listener attached to it.

For the code below, Chrome logs "click" after reallyHeavyOperation is finished.

test.addEventListener('click', () => {
  console.log('click')
})
reallyHeavyOperation();

As I know, browsers handle such DOM events synchroniously(please tell me if I'm mistaken). But how can they do it, when execution thread is blocked with some work? Is there something like UI events queue, where browsers store interactions and then dispatch them, when the call stack becomes free?

I would really appreciate if someone could give links to specifications or source code, so that I could read more about this!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda