bbc / tal

TV Application Layer
http://bbc.github.com/tal
Other
559 stars 150 forks source link

fix exec order in fireEvent #533

Closed Kogoruhn closed 1 year ago

Kogoruhn commented 5 years ago

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!")
});
kukulaka commented 1 year ago

This project is now deprecated, so am closing this PR as no further work is going into this project.