import { shallowRef, onBeforeUnmount } from 'vue';
import '../../../../utils/index.mjs';
import { raf } from '../../../../utils/vue/raf.mjs';

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

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