Created
March 23, 2021 19:36
-
-
Save eamonnboyle/9d3bf479cd64c9ac6b766cc8269478f3 to your computer and use it in GitHub Desktop.
Unwrapping a Tuple of Promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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