2025-03-24 22:56:10 +01:00

18 lines
412 B
JavaScript

export const applyOffset = (from, to) => {
let hasReceivedFrom = true;
if (to === undefined) {
to = from;
hasReceivedFrom = false;
}
return (v) => {
if (hasReceivedFrom) {
return v - from + to;
}
else {
from = v;
hasReceivedFrom = true;
return to;
}
};
};
//# sourceMappingURL=apply-offset.js.map