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

Require Node.js 6, add TypeScript definition, update dependencies #4

Merged
merged 2 commits into from
Mar 2, 2019
Merged

Require Node.js 6, add TypeScript definition, update dependencies #4

merged 2 commits into from
Mar 2, 2019

Conversation

BendingBender
Copy link
Contributor

No description provided.

@sindresorhus sindresorhus changed the title Update dependencies, add TypeScript definition, meta tweaks Require Node.js 6, add TypeScript definition, update dependencies Feb 27, 2019
Result7,
Result8,
Result9,
Result10
Copy link
Owner

Choose a reason for hiding this comment

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

What if there are more than 10 inputs? There must be a better way of achieving this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a not-so-convenient fallback for any number of parameters:

declare function pAll<TAll>(
	tasks: Iterable<PromiseFactory<TAll>> | PromiseFactory<TAll>[],
	options?: Options
): Promise<TAll[]>;

ATM, TypeScript doesn't have a better way to describe this one.

Copy link
Owner

Choose a reason for hiding this comment

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

Do you know if there's any TS issue for this? Seems like a very big limitation.

Copy link
Contributor

@privatenumber privatenumber May 29, 2021

Choose a reason for hiding this comment

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

Seems like you've already found it in sindresorhus/p-progress#10, but for anyone else that's reading this there's a related issue in microsoft/TypeScript#5453, which was addressed via variadic tuple types, but unclear whether it solves this yet

Experimental PR to add variadic tuple to Promise.all microsoft/TypeScript#39796

index.test-d.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 64d1c5c into sindresorhus:master Mar 2, 2019
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.

3 participants