-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[ESLint] enable promise/prefer-await-to-then for non React packages
#3120
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
[ESLint] enable promise/prefer-await-to-then for non React packages
#3120
Conversation
🦋 Changeset detectedLatest commit: f8d1232 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| iteratorReturn?.(); | ||
| return result.value; |
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.
the only thing is that after refactoring to async/await we call iteratorReturn?.() before returning values, previously we did following, does it ok?
resolve(result.value);
// ensure cleanup
iteratorReturn?.();| }; | ||
|
|
||
| this.loadProvider() | ||
| .then() |
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.
I guess call .then is doing nothing
TallTed
left a comment
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.
Minor tweak of comment for clarity
Co-authored-by: Ted Thibodeau Jr <[email protected]>
91333f2 to
f8d1232
Compare
why for non-React - because it's ugly have
async IIFEinsideuseEffect