-
Hi!
In general, say there is a function which receives rest parameter of functions where each one is of type Maybe something like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, it is possible with overloads. So it's not real variation support - it's painful - but works! https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/Pipe/List/Sync.ts (While it works, it is not possible to generalize this from a single type. You will need to type these overloads. If you wanted to type no overloads, you'd need something to keep track of your generics while passing them around microsoft/TypeScript#1213 (comment)) So yes, typing |
Beta Was this translation helpful? Give feedback.
Yes, it is possible with overloads. So it's not real variation support - it's painful - but works!
https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/Pipe/List/Sync.ts
https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/Pipe/Multi/Async.ts
(While it works, it is not possible to generalize this from a single type. You will need to type these overloads. If you wanted to type no overloads, you'd need something to keep track of your generics while passing them around microsoft/TypeScript#1213 (comment))
So yes, typing
Promise.all
is certainly possible - given the two links I have give you above.