I need to pass additional arguments to a function on an event.
I tried bind but it only passes the e and not the result data:
locationSearch.on("result", dropMarker.bind(this, e) );
I could do:
locationSearch.on("result", function(data) {
dropMarker({
e: e,
data: data
});
};
... but then I can't disable the listener locationSearch.off(...) since it is an anonymous function.