Skip to content

Instantly share code, notes, and snippets.

@eamonnboyle
Created March 23, 2021 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eamonnboyle/9d3bf479cd64c9ac6b766cc8269478f3 to your computer and use it in GitHub Desktop.
Save eamonnboyle/9d3bf479cd64c9ac6b766cc8269478f3 to your computer and use it in GitHub Desktop.
Unwrapping a Tuple of Promises
type UnwrapPromises<T extends [...any[]]> =
T extends [infer Head, ...infer Tail]
? [UnwrapPromise<Head>, ...UnwrapPromises<Tail>]
: [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment