async-until

Wait until a given callback returns true

Usage no npm install needed!

<script type="module">
  import asyncUntil from 'https://cdn.skypack.dev/async-until';
</script>

README

async-until

Build Status

Wait until a given callback returns true. Works great with async/await.

import until from 'async-until';

await until(() => something === someOtherThing);

// Or, more verbose
await until(() => something === someOtherThing, {
  timeout: 500,
  failMsg: 'Nope, it does not.',
});