]>
git.r.bdr.sh - rbdr/forum/blob - src/utils/resolve_after.js
1 export const resolveAfter = function (timesUntilResolve
) {
6 if (typeof timesUntilResolve
!== 'number' || timesUntilResolve
<= 0) {
7 throw new Error('Resolve after requires a positive integer');
10 const promise
= new Promise((resolvePromise
) => {
14 if (++currentValue
=== timesUntilResolve
) {