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

Should we have a "bailout" array overload? #5

Open
OliverJAsh opened this issue Jul 8, 2019 · 0 comments
Open

Should we have a "bailout" array overload? #5

OliverJAsh opened this issue Jul 8, 2019 · 0 comments

Comments

@OliverJAsh
Copy link
Member

OliverJAsh commented Jul 8, 2019

Currently, there is a limit on the number of functions that can be passed to pipe (9).

We could have an overload that receives an array, to remove this limit.

This would also allow the use case of spreading an array of any length (rather than a tuple) into pipe: pipe(...myFns). However I would question if doing this is ever a good idea.

One downside of having this array overload is: type inference would disappear when you reach a certain threshold—pipe would return an function that returns unknown.

We tried to add this in the past, however we ran into a TS issue: #3.

Unfortunately this issue we ran into is expected TS behaviour: microsoft/TypeScript#32269 (comment). Therefore this is currently a non-option (unless someone can find another a way around this issue).

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

No branches or pull requests

1 participant