use-time.mjs 268 B

12345678910
  1. import { useAnimationFrame } from '../utils/use-animation-frame.mjs';
  2. import { useMotionValue } from './use-motion-value.mjs';
  3. function useTime() {
  4. const time = useMotionValue(0);
  5. useAnimationFrame((t) => time.set(t));
  6. return time;
  7. }
  8. export { useTime };