'use strict';

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

var vue = require('vue');
var raf = require('../../../_util/raf.js');

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

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