Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default ({ alpha, command }: ClickWheelProps) => {
const [state, x, y] = useValues([State.UNDETERMINED, 0, 0, 0, 0], []);
const deltaX = useDiff(x, []);
const deltaY = useDiff(y, []);
const gestureHandler = onGestureEvent({ state, x, y });
const x0 = cond(eq(state, State.ACTIVE), sub(x, deltaX), x);
const y0 = cond(eq(state, State.ACTIVE), sub(y, deltaY), y);
const a0 = canvas2Polar({ x: x0, y: y0 }, center).alpha;
const a = canvas2Polar({ x, y }, center).alpha;
const da = delta(a0, a);
useCode(() => block([set(alpha, max(add(alpha, da), 0))]), [alpha, da]);
return (
export default ({ alpha, command }: ClickWheelProps) => {
const [state, x, y] = useValues([State.UNDETERMINED, 0, 0, 0, 0], []);
const deltaX = useDiff(x, []);
const deltaY = useDiff(y, []);
const gestureHandler = onGestureEvent({ state, x, y });
const x0 = cond(eq(state, State.ACTIVE), sub(x, deltaX), x);
const y0 = cond(eq(state, State.ACTIVE), sub(y, deltaY), y);
const a0 = canvas2Polar({ x: x0, y: y0 }, center).alpha;
const a = canvas2Polar({ x, y }, center).alpha;
const da = delta(a0, a);
useCode(() => block([set(alpha, max(add(alpha, da), 0))]), [alpha, da]);
return (