Native Function Composition

Jordan Harband ljharb at gmail.com
Sat Aug 26 02:07:31 UTC 2017


"incompatible" is a very strong and likely incorrect claim. `(sync1 |>
sync2 |> async1).then(x => x |> sync3 |> async2).then(x => async3)` could
work just fine.

On Fri, Aug 25, 2017 at 6:43 PM, kai zhu <kaizhu256 at gmail.com> wrote:

> -1
>
> composition and pipeline-operators are both INCOMPATIBLE with
> javascript's async-programming style, and will likely result in
> tech-debt when used.  its fairly common for blocking-code to evolve
> into async-code as features are added, e.g.
>
> ```js
> result = arg |> operator1 |> operator2 |> operator3;
>
> // becomes spaghetti-code when operator2 evolves
> // to require async-merging with database-queries, file-reads, etc.
>
> ...
> operatorAsync2(arg |> operator1, function (error, data) {
>     if (error) {
>         ...
>         return
>     }
>     result = data |> operator3;
>     ...
> });
>
> ```
>
>
> On 8/25/17, Simon Staton <simon.staton at bynd.com> wrote:
> > That link appears to be broken Naveen, If you are considering a similar
> > approach let’s collaborate would be interested to get your outlook on
> this
> > and we could probably expand on either of these
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170825/6a29275e/attachment.html>


More information about the es-discuss mailing list