Skip to content

Commit

Permalink
Use requestIdleCallback from core.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbatiste committed Aug 29, 2019
1 parent 7165748 commit 4a21a98
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions requestIdleCallback.js
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 4a21a98

Please sign in to comment.