Re:Pipe Operator (|>) For JavaScript
by scotty79 on Friday January 20, 2023 @01:02PM
(#34457045)
It's not jarring. It expresses what is the subject that's being processed and what are additional parameters of the processing steps. This allows to keep all parameters of each processing step together and processing steps easily visually separable.
[ Parent
| on HN ]
> It's not jarring. It expresses what is the subject that's being processed and what are additional parameters of the processing steps.
Only if the first parameter of the function is the sole subject & subsequent parameters are "additional". Which isn't the case in this example: all params are equal subjects.
Right. `chalk.dim()` is probably not the best thing to use as an example for this.
But you can still think about this as merging in two additional pipes into the one you are processing. So 'node' and argsOutput are just very short pipes that you are merging into the flow of current one.
Btw... chalk API feels super weird.