@vgerbot/async
    Preparing search index...

    Function doUntil

    • Executes an iteratee at least once, then repeatedly until the async test returns true. Similar to until but the test is evaluated after each iteration (do-until loop).

      Parameters

      • iteratee: WhilstIteratee

        Async body executed at least once, then until test is true.

      • test: WhilstTest

        Exit condition evaluated after each iteration.

      • Optionaloptions: CancellableOptions<unknown>

        Cancellable configuration options.

      Returns CancellableHandle<unknown>

      A cancellable handle that resolves when the loop exits.

      let done = false;
      let ticks = 0;
      const handle = doUntil(
      async (token) => {
      await token.sleep(5);
      ticks++;
      if (ticks >= 2) done = true;
      },
      async () => done,
      );

      await handle;
      // ticks === 2