3.0.3 • Published 8 years ago
apr-until v3.0.3
until
Repeatedly call fn until test returns true.
Parameters
Examples
import until from 'apr-until';
const then = (v) => new Promise((resolve) => resolve(v));
const maxCalls = 10;
let calls = 0;
const output = await until(async () => {
  await then();
  return (calls += 1) >= maxCalls;
}, async () => (
  await then(calls)
);
// output = 10Returns Promise