xaa
    Preparing search index...

    Function delay

    • delay some milliseconds and then return valOrFunc

      Sample:

      await xaa.delay(500);
      await xaa.delay(500, "Result");
      await xaa.delay(500, () => "Result");

      Parameters

      • delayMs: number

        number milliseconds to delay

      Returns Promise<void>

      valOrFunc or its returned value if it's a function.

    • delay some milliseconds and then return valOrFunc

      Sample:

      await xaa.delay(500);
      await xaa.delay(500, "Result");
      await xaa.delay(500, () => "Result");

      Type Parameters

      • T = void

      Parameters

      • delayMs: number

        number milliseconds to delay

      • valOrFunc: T

        the value to return. If it's a function, call it to get the value. It can be an async function.

      Returns Promise<T>

      valOrFunc or its returned value if it's a function.