You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was having a look over the code to see if I can remove an event just by ID, and I think I see an issue here. Given that it lists id as optional, but checks it against the event, as well as the function, I don't think one can remove an event by using the function parameter at all.
A simple fix here would be to swap it to an ||. Or one can change it to:
if (fn === events[i].fn && (!id || id === events[i].id))
To cover what the API says it will do :)
The text was updated successfully, but these errors were encountered:
This is partially intended behavior. If you passed an ID into on, then you need to pass an ID into off because if you don't pass ID into on it is a different type of listener. However, I just pushed a commit that allows you to cancel like sound.off('play', id); instead of having to pass the function as well.
ringcrl
pushed a commit
to ringcrl/howler.js
that referenced
this issue
Apr 21, 2019
howler.js/src/howler.core.js
Line 1560 in 7547703
Was having a look over the code to see if I can remove an event just by ID, and I think I see an issue here. Given that it lists id as optional, but checks it against the event, as well as the function, I don't think one can remove an event by using the function parameter at all.
A simple fix here would be to swap it to an ||. Or one can change it to:
To cover what the API says it will do :)
The text was updated successfully, but these errors were encountered: