pixijs/spine

`state.removeListener` not as expected

xieyhn opened this issue · 2 comments

Example below, when I remove the callback when the first callback is called, then the second callback never gets called.

const animation = new Spine(/* ... */)

const listener = {
  complete: () => {
    animation.state.removeListener(listener)
  },
}

animation.state.addListener(listener)
animation.state.addListener({
  complete: () => {
    // Never called
  },
})

"pixi-spine": "^4.0.4"

Maybe the problem is in the for i loop that calls the callback