JavaScript Pipelines and the Pipeline Operator Proposal
Introduction
JavaScript has continually evolved, integrating new para...
For further actions, you may consider blocking this person and/or reporting abuse
This article was recently posted, but it's content seems fairly outdated. Maybe it was a repost of an article made a little while ago? Despite what the article claims, there's no chance that this will be adopted in ECMAScript 2024 - not without a time machine that is :).
More importantly though, it has been decided that the operand to the pipe operator isn't going to be a function that gets called, instead it's going to be an arbitrary expression with a special placeholder token (such as ^^) that you use to say "put the value from the previous step here". (You can look at the proposal for an in depth explanation: github.com/tc39/proposal-pipeline-...). So a lot of the syntax examples and "passing parameters" section is now outdated.
Thanks for the correction
Thx for post, I am a big fun of pipeline operator, even I used successfully on a scientic react project 2 years long 5 y ago. I will waiting the implementation.
Thanks for liking it :)
Yeah it's like a glorified map/filter/reduce ... reminds me a bit of Haskell !
pretty similar
The following example code provided in this post may not work how you expect it to:
As semicolon in JavaScript is optional, the statement
return data
should be considered as a complete statement, and the piped lines below it should not execute. So, either of the following approaches may be needed:Or
Reminds me of F#
Gnarly
I don't believe
Handling Promises in Pipelines
example will actually work, since there is no awaiting happening, and I was under the impression pipelines did not auto unwrap thenables.Elm lang syntax