Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created September 15, 2020 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/80b97a2b18b0926b9a601a0ea5fdea2a to your computer and use it in GitHub Desktop.
Save velotiotech/80b97a2b18b0926b9a601a0ea5fdea2a to your computer and use it in GitHub Desktop.
function lowPriorityWork(deadline) {
while (deadline.timeRemaining() > 0 && workList.length > 0)
performUnitOfWork();
if (workList.length > 0)
requestIdleCallback(lowPriorityWork);
}
@robert8888
Copy link

robert8888 commented Nov 25, 2021

requestIdleCallback(lowPriorityWork.bind(null, deadline));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment