mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
10 lines
256 B
JavaScript
10 lines
256 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;
|
|
}
|