-
-
Save vedovelli/ae8c543741164dca69fed988dd4b492d to your computer and use it in GitHub Desktop.
Async, Recursive .... function!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function awaitSubmissionFinish(submissionID, status) { | |
const response = await submissionInfo(submissionID) | |
if(status == 0) return response | |
return new Promise(resolve => { | |
setTimeout(() => resolve(awaitSubmissionFinish(submissionID, response.status)), 5000) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment