You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was excited today to see the Function.pipe/flow proposal.
I think the direction of standardizing ECMAScript APIs to solve the well-known problems of callback complexity is something that should be explored.
The Pipeline champions considered "hack style" and "F# style" options for the pipeline proposal. However, it would be useful to see a third "API style" option. In other words, take the examples that motivate the pipeline syntax operator and show how they would work with Function.pipe, Function.pipeAsync, etc.
I would note that the "API style" is already popularized by the async package on npm, so there is a deep set of prior art for this.
The text was updated successfully, but these errors were encountered:
Thanks, @sffc! (To make it clear, when I presented proposal-function-pipe-flow, I did not intend for it to be a potential supplanter of the pipe operator, but rather as an adjunct or complement for serial callbacks.) But, yes, and we definitely could call the function-API-only possibility out in the explainer, and we could make comparisons with its real-world examples.
For what it’s worth, I myself did consider a world with Function.pipe only, and I checked the real-world code examples I put in the explainer. This was a while back…
As far as I could tell, the answer would still generally favor the topic-style pipe operator over. For example, consider the explainer’s first example, from React v17.0.2:
This is not an example where Function.pipe would particularly shine (especially given the engines’ concern about encouraging developers to allocate more throwaway closures; cf. #221):
I was excited today to see the Function.pipe/flow proposal.
I think the direction of standardizing ECMAScript APIs to solve the well-known problems of callback complexity is something that should be explored.
The Pipeline champions considered "hack style" and "F# style" options for the pipeline proposal. However, it would be useful to see a third "API style" option. In other words, take the examples that motivate the pipeline syntax operator and show how they would work with Function.pipe, Function.pipeAsync, etc.
I would note that the "API style" is already popularized by the async package on npm, so there is a deep set of prior art for this.
The text was updated successfully, but these errors were encountered: