'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../../utils/index.cjs');
var raf = require('../../../../utils/vue/raf.cjs');

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

exports.default = useFrame;
//# sourceMappingURL=useFrame.cjs.map
