The eventedone function only triggers one time with multiple listener, when the mixin object is not targeting itself.
Evented Mixin on self
let triggered = 0;
let el = new Component();
const listener = () => triggered++;
el.one(['a', 'b'], listener);
el.trigger('a');
// triggered is 1
el.trigger('b');
// triggered is 2
Evented Mixin on other
let triggered = 0;
let el = new Component();
let el2 = new Component();
el.one(el2, ['a', 'b'], listener);
el2.trigger('a');
// triggered is 1
el2.trigger('b');
// triggered is still 1
The issue is is due to a this.off call that removes all of the event listeners rather than just the one that triggered the listener.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The
evented
one
function only triggers one time with multiple listener, when the mixin object is not targeting itself.Evented Mixin on self
Evented Mixin on other
this.off
call that removes all of the event listeners rather than just the one that triggered the listener.