• A function to allow a promise resolution to be delayed by a number of milliseconds. Usage is as follows:

    const stringValue = await myPromise.then(delay(600)).then(value => value.toString());

    Type Parameters

    • T

    Parameters

    • ms: number

      the number of millisecond to delay

    Returns ((value) => Promise<T>)

    a function that returns a promise that returns the given value, but delayed

      • (value): Promise<T>
      • Parameters

        • value: T

        Returns Promise<T>