clarity
clarity copied to clipboard
`requestIdleCallback` polyfill is wrongly implemented
The timeRemaing callback in requestIdleCallback polyfill always returns the same number.
Steps to replicate:
Run this function
requestIdleCallbackPolyfill((deadline) => {
// infinite loop
while (deadline.timeRemaining() > 0) {
console.log((deadline.timeRemaining());
}
})
Suggested changes: https://www.diffchecker.com/oBCHzF5I