Comment

Comment by jarek-foksa

I have a question about the talk by Philip Roberts ("Help, I'm stuck in an event-loop").

In the following code, assuming that there are no read errors, is the load callback guaranteed to be always executed? I.e. are DOM events dispatched only after the call stack is cleared?

  let main = () => {
    let reader = new FileReader();
    reader.readAsText(file);
    reader.addEventListener("load", callback = (event) => console.log(event.target.result));
  };
parent jarek-foksa 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton