"use strict";const e=require("../../../../common/vendor.js"),n=require("../common/util.js");exports.useRaf=function(t){const u=e.ref(null),o=()=>{n.isH5&&n.isNumber(u.value)?cancelAnimationFrame(u.value):n.isDef(u.value)&&clearTimeout(u.value)};return e.onUnmounted((()=>{o()})),{start:()=>{const e=e=>{t(e)};n.isH5?u.value=requestAnimationFrame(e):u.value=setTimeout((()=>e(Date.now())),1e3/30)},cancel:o}};
