Skip to content

Commit

Permalink
simplifying code
Browse files Browse the repository at this point in the history
  • Loading branch information
camillobruni committed Nov 8, 2023
1 parent c38d7f4 commit faa97f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/benchmark-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class Page {
return new Promise((resolve) => {
const resolveIfReady = () => {
const element = this.querySelector(selector);
let callback = resolveIfReady;
if (element)
resolve(element);
else
window.requestAnimationFrame(resolveIfReady);
callback = () => resolve(element);
window.requestAnimationFrame(callback);
};
resolveIfReady();
});
Expand Down

0 comments on commit faa97f4

Please sign in to comment.