INNER CODE UNIT · TypeScript

clamp

terrysahaidak/react-native-gallery-toolkit · packages/common/src/common.ts:69

export function clamp(
  value: number,
  lowerBound: number,
  upperBound: number,
) {
  'worklet';

  return Math.min(Math.max(lowerBound, value), upperBound);
}

export const workletNoop = () => {
  'worklet';
};

export const typedMemo: <T>(c: T) => T = React.memo;

export function clampVelocity(
  velocity: number,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…