UNPKG

@gorhom/bottom-sheet

Version:

A performant interactive bottom sheet with fully configurable options 🚀

11 lines (9 loc) • 335 B
"use strict"; export const snapPoint = (value, velocity, points) => { 'worklet'; const point = value + 0.2 * velocity; const deltas = points.map(p => Math.abs(point - p)); const minDelta = Math.min.apply(null, deltas); return points.filter(p => Math.abs(point - p) === minDelta)[0]; }; //# sourceMappingURL=snapPoint.js.map