Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state.removeListener not as expected #550

Open
xieyhn opened this issue May 11, 2024 · 2 comments
Open

state.removeListener not as expected #550

xieyhn opened this issue May 11, 2024 · 2 comments

Comments

@xieyhn
Copy link

xieyhn commented May 11, 2024

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
  },
})
@xieyhn
Copy link
Author

xieyhn commented May 11, 2024

"pixi-spine": "^4.0.4"

@xieyhn
Copy link
Author

xieyhn commented May 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant