3.0.3 • Published 6 years ago

apr-until v3.0.3

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

until

Repeatedly call fn until test returns true.

npm.io npm.io

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 = 10

Returns Promise

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago