I need to have a bound event listener function to reference itself, but I don't see a way to access itself in strict mode (arguments.callee
is not available).
See the following code snippet for an example:
function callback(boundParam, event) {
// This does not work here as not 'callback' was added
// to the event bus but 'boundCallback'
eventBus.removeListener(callback);
}
function foo () {
const boundCallback = callback.bind({}, 7);
eventButs.addListener(boundCallback);
}
What are my options?
This is NOT a duplicate of JavaScript: remove event listener as I need to reference a bound function!