Executes an iteratee at least once, then repeatedly while the async test returns true. Similar to whilst but the test is evaluated after each iteration (do-while loop).
Async body executed at least once, then while test is true.
test
Condition evaluated after each iteration.
Optional
Cancellable configuration options.
A cancellable handle that resolves when the loop exits.
let count = 0;const handle = doWhilst( async (token) => { await token.sleep(5); count++; }, async () => count < 3,);await handle;// count === 3 Copy
let count = 0;const handle = doWhilst( async (token) => { await token.sleep(5); count++; }, async () => count < 3,);await handle;// count === 3
Executes an iteratee at least once, then repeatedly while the async test returns true. Similar to whilst but the test is evaluated after each iteration (do-while loop).