@madeja-studio/telar
Version:
UI component library by Madeja Studio
17 lines (16 loc) • 402 B
JavaScript
;
/**
* This interpolation is used for pan gestures where we want the panned node to
* feel like it's fighting a resistance that prevents it from moving further.
*/
export const withDrag = ({
threshold,
value
}) => {
if (value > threshold) {
return threshold + (value - threshold) * (threshold / value);
} else {
return value;
}
};
//# sourceMappingURL=withDrag.js.map