3 ms·
This idea has been toyed with for a decade. Im pretty sure lodash still has a pipe method somewhere. I actually prefer the `.pipe` function over the proposed op
by ricardobeat 5y ago
This idea has been toyed with for a decade. Im pretty sure lodash still has a pipe method somewhere. I actually prefer the `.pipe` function over the proposed operator, but we’ve had that available for 10+ years with very little adoption.
Unless the new operator was wildly easier to use (it’s not), that adoption says everything we need to know about the need to add this feature to JS.
- egeozcan 5y agoI did develop a library and am still of the opinion that the native implementation is vastly superior. You cannot use .pipe unless you break other code and start changing prototypes of all the things, or you wrap the result every time. So when I'm writing an expression, I need to go back and write pipe(expression).pipe(... Also the placeholder is much easier to use than using something like my solution (const _ = pipe._) for it. You don't need to remember importing/defining it! I was even toying with a crazier version (notice the extra p, yeah I suck at naming things): https://github.com/egeozcan/pppipe/ https://github.com/egeozcan/pppipe/ The only reason that exists is to prevent the clutter of writing .pipe all the time. Yet another reason is, you'd get autocomplete with a native implementation, and also TS support! Also, it's been toyed for surely more than a decade, even my library is 6 years old (older if you count my previous non-public attempts).