Files
iD/modules/util/bind_once.js
2016-10-04 19:06:20 -04:00

10 lines
260 B
JavaScript

export function utilBindOnce(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;
}