raf.mjs 329 B

123456789
  1. import { isClient } from "./browser.mjs";
  2. //#region ../../packages/utils/raf.ts
  3. const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
  4. const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
  5. //#endregion
  6. export { cAF, rAF };
  7. //# sourceMappingURL=raf.mjs.map