Re:Pipe Operator (|>) For JavaScript
by tracker1 on Friday January 20, 2023 @02:23PM
(#34458356)
Not really... F#-style pipeline syntax would be a bit more explicit about it, assuming you could use % for a variable name...
To be honest, I've pretty much given up the hopes that TC39 would actually resolve pipelines and decorators at this point... I think it's been around a decade now.
[ Parent
| on HN ]
But then why would you call all those different variables ‘%’?
Reading this version though I also notice something else that the F# style enables that the Hack style doesn’t which is that it supports destructuring. So in F# style, I can more easily make pipe steps that pass on multiple values in a structured object or array, then access them easily down-pipe.
Unfortunately F# pipelines have been rejected a few times by TC39 to advance... I used it for a while via Babel/6to5, but I gave up (like with decorators) after many years of no advancement. I doubt I'll see either any time soon.