Skip to content

Instantly share code, notes, and snippets.

@holgergp
Created January 14, 2022 10:31
Show Gist options
  • Save holgergp/ebb95109ecb8dedb7d5eb828a86fb8e4 to your computer and use it in GitHub Desktop.
Save holgergp/ebb95109ecb8dedb7d5eb828a86fb8e4 to your computer and use it in GitHub Desktop.
Promise.all() (TypeScript 4.5 article)
const result = await Promise.all([Promise.resolve(10), Promise.resolve(20)]);
all<T1, T2>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment