tal icon indicating copy to clipboard operation
tal copied to clipboard

fix exec order in fireEvent

Open Kogoruhn opened this issue 6 years ago • 0 comments

This fix solves the problem with execution of listeners (as below)

this.addEventListener("aftershow", function run() {
  console.log("1st listener!")
});

this.addEventListener("aftershow", function run2() {
  console.log("2nd listener!")
  console.log("breaking listeners chain...")
  self.removeEventListener("aftershow", run2);
});

this.addEventListener("aftershow", function run3() {
  console.log("3rd listener misssed now, will be started only at the next 'aftershow'")
});

this.addEventListener("aftershow", function run4() {
  console.log("4th listener!")
});

Kogoruhn avatar Aug 13 '19 15:08 Kogoruhn