diff --git a/requestIdleCallback.js b/requestIdleCallback.js index a758b59..ba3d1a0 100644 --- a/requestIdleCallback.js +++ b/requestIdleCallback.js @@ -1,15 +1 @@ -window.requestIdleCallback = window.requestIdleCallback || function(cb) { - var start = Date.now(); - return setTimeout(function() { - cb({ - didTimeout: false, - timeRemaining: function() { - return Math.max(0, 50 - (Date.now() - start)); - } - }); - }, 1); -}; - -window.cancelIdleCallback = window.cancelIdleCallback || function(id) { - clearTimeout(id); -}; +import '@brightspace-ui/core/helpers/requestIdleCallback.js';