Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
chore: convert waitOnIdle to normal function
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Apr 5, 2021
1 parent fb51a78 commit 650c896
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ const config = {
// Worker still hasn't initialized, since the queued idle callbacks are
// done in order, waiting on a newly queued idle callback will ensure that
// the worker has been initialized
const waitOnIdle = async () => new Promise((resolve) => {
const callbackID = window.requestIdleCallback(() => {
idleCallbacks.delete(callbackID);
resolve();
function waitOnIdle() {
return new Promise((resolve) => {
const callbackID = window.requestIdleCallback(() => {
idleCallbacks.delete(callbackID);
resolve();
});
idleCallbacks.add(callbackID);
});
idleCallbacks.add(callbackID);
});
};

const TsLintPackage = {
activate() {
Expand Down

0 comments on commit 650c896

Please sign in to comment.