Function noopPromise

Returns a promise that immediately resolves to T, useful when you need to mix sync and async code.

const promises: Promise<number>[] = [];

promises.push(noopPromise(10));
  • Type Parameters

    • T

    Parameters

    • val: T

    Returns Promise<T>