Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 503 Bytes

4-separate-handlers.md

File metadata and controls

19 lines (14 loc) · 503 Bytes

Experiment: separate handlers

What if you move the work to a separate Event Handler? Update the UI in one Event Handler, and block the page from a separate handler.

Answer
button.addEventListener("click", () => {
  score.incrementAndUpdateUI();
});
  
button.addEventListener("click", () => {
  blockFor(1000);
});

Next: Experiment: different event types