UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

16 lines (15 loc) 456 B
export const requestIdleCallback = import.meta.server ? () => { } : globalThis.requestIdleCallback || ((cb) => { const start = Date.now(); const idleDeadline = { didTimeout: false, timeRemaining: () => Math.max(0, 50 - (Date.now() - start)) }; return setTimeout(() => { cb(idleDeadline); }, 1); }); export const cancelIdleCallback = import.meta.server ? () => { } : globalThis.cancelIdleCallback || ((id) => { clearTimeout(id); });