From 4a21a988d33d8843e242ed4069d38fc2ddb5545a Mon Sep 17 00:00:00 2001 From: Dave Batiste Date: Thu, 29 Aug 2019 13:58:57 -0400 Subject: [PATCH] Use requestIdleCallback from core. --- requestIdleCallback.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) 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';