Skip to content

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

Merged
sindresorhus merged 2 commits intosindresorhus:masterfrom
BendingBender:typescript-defs
Mar 2, 2019
Merged

Require Node.js 6, add TypeScript definition, update dependencies#4
sindresorhus merged 2 commits intosindresorhus:masterfrom
BendingBender:typescript-defs

Conversation

@BendingBender
Copy link
Copy Markdown
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
Comment thread index.d.ts
Result7,
Result8,
Result9,
Result10
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread index.test-d.ts Outdated
@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