Skip to content
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

fix: improve a promise all via parameter pack #14

Merged
merged 3 commits into from
Mar 18, 2025
Merged

Conversation

minjae999
Copy link
Contributor

@minjae999 minjae999 commented Mar 18, 2025

Changes

Promise.all has been improved using Swift 5.9 Parameter Packs. It can now handle any number of parameters without being limited by a fixed count.

Previously, Promise.all only supported up to five promises and had a separate method for cases where the promise's Failure was Never. With Parameter Packs, these have been unified into a single method.

When using Promise.all with parameters of type [Promise<Value, Failure>](when using an array), the existing code has been retained.

Example

Promise.all(
    p1, p2, p3, p4, p5, p6
)

@minjae999 minjae999 requested a review from 0xWOF March 18, 2025 02:59
@minjae999 minjae999 self-assigned this Mar 18, 2025
0xWOF
0xWOF previously approved these changes Mar 18, 2025
@0xWOF 0xWOF force-pushed the feature/parameter_pack branch from df0cd02 to 4dfc168 Compare March 18, 2025 06:06
@0xWOF 0xWOF merged commit e894bb4 into main Mar 18, 2025
2 checks passed
@0xWOF 0xWOF deleted the feature/parameter_pack branch March 18, 2025 06:08
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