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

248
Vistas
FileSystemDirectoryReader.readEntries: Is there a way to read files from folder sync?

FileSystemDirectoryReader.readEntries lets us read the file contents however is it is async in nature and I need to do it in a synchronous way. I have tried using async and that doesn't fit my use case as well. What I want is somewhat similiar to this. Which freezes the main thread.

var request = new XMLHttpRequest();
request.open('GET', '/bar/foo.txt', false);  // `false` makes the request synchronous
request.send(null);

if (request.status === 200) {
  console.log(request.responseText);
}

I know it is bad user experience but it seems unavoidable at this point.

The use case

We have multiple event handlers listening to the drop event. I need to so some processing in my event handler (It's guaranteed to be the first one to receive) based on which I can decide whether the other event handlers should not process the event using event.stopImmediatePropagation but if I am doing stuff which is async the other handlers receive and continue to process the event even if I decide to stop propagation. I have no control over the other handlers and cant modify their code

I have tried stopping the propagation before my async call and dispatch the event after processing but that is proving to be difficult as the event.dataTransfer is empty and the other event handlers are not getting the files. Force setting the dataTransfer results in isTrusted being set to false for the event

Javascript DataTransfer items not persisting through async calls

about 4 years ago · Santiago Trujillo
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