import { useEffect, useRef } from 'react';

const useFrameCountRef = <T>(valueToWatch?: T) => {
  const frameCountRef = useRef(0);
  useEffect(() => {
    frameCountRef.current++;
  }, [valueToWatch]);
  return frameCountRef;
};

export default useFrameCountRef;
