79460242

Date: 2025-02-22 20:27:31
Score: 1
Natty:
Report link
function WaitUntilThen(condition, callback) {
    return new Promise(resolve => {
        const intervalId = setInterval(() => {
            if (condition()) {
                clearInterval(intervalId);
                resolve();
            }
        }, 100); 
    }).then(callback);

}

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Pedro Almache