draggable icon indicating copy to clipboard operation
draggable copied to clipboard

Fix removing multiple event listeners of the same type

Open mladenilic opened this issue 6 years ago • 0 comments

This PR implements or fixes...

Emitter#off fails to remove multiple event listeners of the same type. This PR also adds "removes multiple callbacks of event type" test case which demonstrates this issue.

The Array.filter() approach is slightly faster as well (at least on Chrome, but probably across the board):

splice – 100000 x 50 elements: 254.009765625ms
filter – 100000 x 50 elements: 53.3818359375ms
–––––––––––––––––––––
splice – 100000 x 100 elements: 502.173095703125ms
filter – 100000 x 100 elements: 72.447998046875ms
–––––––––––––––––––––
splice – 100000 x 150 elements: 707.951171875ms
filter – 100000 x 150 elements: 98.218994140625ms

Does this PR require the Docs to be updated?

No

Does this PR require new tests?

No

mladenilic avatar Nov 19 '19 00:11 mladenilic