This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Description
I've noticed that using .removeEventListener
on my event listeners no longer works because the actual function that is submitted to addEventListener
is a function wrapper from Rollbar. Put simply, this doesn't work:
const handler = e => e.target;
// the event listener gets set correctly
node.addEventListener('click', handler, false);
// but I can no longer remove it because this doesn't work, clicking the node still triggers the handler
node.removeEventListener('click', handler, false);
I can see in my debugger that the actual handler is a rollbar wrapped function, and I don't have a way of getting a reference to that function, so I can't pass it to removeEventListener
. What's the way out here?