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
the handler will not get removed. Apparently thjis is because a new closure is created with each parameter reference to the method foo, so they are not seen as the same thing.
OTOH this works:
void bar(e) {}
var foo = bar;
window.on.message.add(foo);
window.on.message.remove(foo);
It would be good if this was fixed, and if not possible, then it should be clearly documented as it is real gotcha.
The text was updated successfully, but these errors were encountered:
If you have this:
void foo(e) {}
window.on.message.add(foo);
window.on.message.remove(foo);
the handler will not get removed. Apparently thjis is because a new closure is created with each parameter reference to the method foo, so they are not seen as the same thing.
OTOH this works:
void bar(e) {}
var foo = bar;
window.on.message.add(foo);
window.on.message.remove(foo);
It would be good if this was fixed, and if not possible, then it should be clearly documented as it is real gotcha.
The text was updated successfully, but these errors were encountered: