silverwolf-x/project / packages /next /src /client /request-idle-callback.ts
silverwolf-x's picture
download
raw
630 Bytes
export const requestIdleCallback =
(typeof self !== 'undefined' &&
self.requestIdleCallback &&
self.requestIdleCallback.bind(window)) ||
function (cb: IdleRequestCallback): number {
let start = Date.now()
return self.setTimeout(function () {
cb({
didTimeout: false,
timeRemaining: function () {
return Math.max(0, 50 - (Date.now() - start))
},
})
}, 1)
}
export const cancelIdleCallback =
(typeof self !== 'undefined' &&
self.cancelIdleCallback &&
self.cancelIdleCallback.bind(window)) ||
function (id: number) {
return clearTimeout(id)
}

Xet Storage Details

Size:
630 Bytes
·
Xet hash:
264e1e69517b2d51dd1a5e8175e3199f07da1862faa92b0440aea76f04623739

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.