Files
iD/modules/util/bind_once.js
2016-08-21 15:19:27 -04:00

10 lines
257 B
JavaScript

export function bindOnce(target, type, listener, capture) {
var typeOnce = type + ".once";
function one() {
target.on(typeOnce, null);
listener.apply(this, arguments);
}
target.on(typeOnce, one, capture);
return this;
};