DEV Community

Discussion on: Functional pipe

Collapse
 
jamesrweb profile image
James Robb

I updated the check because actually the jsdoc expects just an array of functions to be in the fns variable and so I updated the code accordingly, open to feedback but I think this is cleaner either way. I also added your extra test with some modifications to the article.

Collapse
 
th0rgall profile image
Thor Galle

Looks good to me! Now it's consistent.
The spread operator can also be used when calling pipe, like pipe(...[f1, f2], ...[f3, f4], f5), so if you know for sure there will be an array (or arrays) of functions to input, that's still possible this way.

Thread Thread
 
jamesrweb profile image
James Robb

Exactly. Appreciate the input though! 👍

Thread Thread
 
jamesrweb profile image
James Robb

Exactly which still matches the initial intention anyway and keeps things more consistent too.