Calls a function repeatedly while a condition returns true and then resolves the promise
Think async version of the
$ npm install p-do-whilst
import pDoWhilst from 'p-do-whilst'; let count = 0; await pDoWhilst( () => count++, () => count < 5 ); console.log(count); //=> 5
action repeatedly while
true and then resolves the promise. Rejects if
action returns a promise that rejects or if an error is thrown anywhere.
Action to run for each iteration.
You can return a promise and it will be handled.
Expected to return a boolean of whether to continue.