Created
April 23, 2019 21:37
-
-
Save DimitarNestorov/de3598a2de325b2cb140f74eb060c601 to your computer and use it in GitHub Desktop.
TypeScript toolset
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 PromiseType<T> = T extends Promise<infer U> ? U : T | |
// const myPromise = new Promise<string>(() => {}) | |
// type MyPromiseType = PromiseType<typeof myPromise> // string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment