DEV Community

Discussion on: A simple explanation of functional pipe in JavaScript

Collapse
 
lorefnon profile image
Lorefnon

Unfortunately typescript doesn't provide a good way to impose type constraints on functions with unlimited variadic arguments.

So pipeline function implementations like the above can be made type safe only by repeated overrides upto an arbitrarily determined maximum arity. Example.

I am curious why the RxJS team didn't opt for a fluent API (like this one) which does not suffer from a similar issue.

Collapse
 
asti profile image
Asti

They originally did use a fluent API. Then for RxJS5... bad decisions were made.