INNER CODE UNIT · TypeScript

workletNoop

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

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

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

export function clampVelocity(
  velocity: number,
  minVelocity: number,
  maxVelocity: number,
) {
  'worklet';

  if (velocity > 0) {
    return Math.min(Math.max(velocity, minVelocity), maxVelocity);
  } else {
    return Math.max(Math.min(velocity, -minVelocity), -maxVelocity);
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…