Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework check, remove arg
Browse files Browse the repository at this point in the history
frolic committed Mar 11, 2024
1 parent ab5d6b9 commit d484103
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/common/src/utils/waitForIdle.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export function waitForIdle(ms = 1): Promise<void> {
export function waitForIdle(): Promise<void> {
return new Promise<void>((resolve) => {
if ('requestIdleCallback' in window) {
if (typeof requestIdleCallback !== "undefined") {
requestIdleCallback(() => resolve());
} else {
setTimeout(() => resolve(), ms);
setTimeout(() => resolve(), 1);
}
});
}

0 comments on commit d484103

Please sign in to comment.