Skip to content

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

@OliverJAsh

Description

@OliverJAsh

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions