INNER CODE UNIT · TypeScript
useRunOnce
terrysahaidak/react-native-gallery-toolkit · packages/common/src/useInit.ts:16
function useRunOnce(cb: () => void) {
const ref = useRef<boolean | null>(null);
if (ref.current === null) {
cb();
ref.current = true;
}
}
const usedWorklets = {
withTiming,
withSpring,
bezier: Easing.bezier,
interpolate,
withDecay,
useAnimatedGestureHandler,
...usedVectors,
} as { [key: string]: any };