import { shallowRef, onBeforeUnmount } from 'vue';
import wrapperRaf from '../../../_util/raf.mjs';

var useFrame = () => {
  const idRef = shallowRef(0);
  const cleanUp = () => {
    wrapperRaf.cancel(idRef.value);
  };
  onBeforeUnmount(() => {
    cleanUp();
  });
  return (callback) => {
    cleanUp();
    idRef.value = wrapperRaf(() => {
      callback();
    });
  };
};

export { useFrame as default };
//# sourceMappingURL=useFrame.mjs.map
