Skip to content

Conversation

@yagebu
Copy link
Contributor

@yagebu yagebu commented Aug 10, 2020

When awaiting the value of a type like Promise | null, the type
wouldn't match PromiseLike. Hence the awaited value would still be
Promise | null and not string | null. Reducing it to one type
declaration and using a conditional type to infer the awaited type
should do the trick.

When awaiting the value of a type like Promise<string> | null, the type
wouldn't match PromiseLike. Hence the awaited value would still be
Promise<string> | null and not string | null. Reducing it to one type
declaration and using a conditional type to infer the awaited type
should do the trick.
@dummdidumm
Copy link
Member

Makes sense 👍 Thank you!

@dummdidumm dummdidumm merged commit bc7c0ff into sveltejs:master Aug 10, 2020
@yagebu yagebu deleted the await-promise-or-plain-value branch August 10, 2020 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants