-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe async refactor #1287
Maybe async refactor #1287
Conversation
This pull request fixes 1 alert when merging 0916400 into b95c714 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - We should probably dig a little into the TS spec to see what exactly allows us to await a union of T
and Promise<T>
, but if it fits I sits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇 looks good!
@@ -1,18 +1 @@ | |||
export type MaybeAsync<T> = Promise<T> | T; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow, had no clue you could await a non-async function and it'd return just fine.
No description provided.