The promise repeater plugin allows you to "try" and repeat promises until they are resolved. It also allows you establish a margin of milliseconds between each try.
Attempt 1Attempt 2Attempt 3ResolvedAttempt 1// Second #2Attempt 2// Second #4Attempt 3// Second #6ResolvedAttempt 1Attempt 2Attempt 3ResolvedAttempt 1// Throw the error on method `promiseFunction` since it ran out of attemps and it was never resolved.error: Uncaught Error:if(i <3) thrownewError();