Created
August 3, 2022 03:22
-
-
Save MauricioRobayo/3ba47c85612b32c5d78a61fd57dd108c to your computer and use it in GitHub Desktop.
Infer returned type of a promise
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 PromiseReturnType<T> = T extends Promise<infer R> ? R : T; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment