Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@climba03003
Copy link
Member

Related #5603

Use Promise.withResolvers to reduce the needs of multiple new Promise.
It helps to flatten the code and remove unnecessary Promise.race.

Checklist

@climba03003 climba03003 force-pushed the refactor-promise-resolvers branch from 086a64c to 3e4d41c Compare June 21, 2025 00:26
@climba03003 climba03003 force-pushed the refactor-promise-resolvers branch from 3e4d41c to 549056f Compare June 21, 2025 00:36
Copy link
Member

@jean-michelet jean-michelet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, but there isn't much changes on the overall codebase.
Did you identify other use cases?

@climba03003
Copy link
Member Author

climba03003 commented Jun 24, 2025

Looks nice, but there isn't much changes on the overall codebase.

I don't think it should be a massive change to the codebase.
Promise.withResolvers is a helper function which reduce unnecessary wrapping.

Did you identify other use cases?

Currently, no time to investigate more.
But I can see we can replace some of the test with Promise.withResolvers.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@climba03003 climba03003 merged commit 32d224a into main Jun 26, 2025
47 of 52 checks passed
@climba03003 climba03003 deleted the refactor-promise-resolvers branch June 26, 2025 00:45
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.

5 participants