We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think it would be nice to have conditional function chaining, like the following:
a .x! .y! if foo .z!
...which will be compiled to:
var x$; x$ = a; x$ = x$.x(); if (foo) { x$ = x$.y(); } x$ = x$.z();
This feature will be useful when we need a conditional middle step on a long function chain.
The text was updated successfully, but these errors were encountered:
For comparison, currently possible patterns:
Cascade with conditional:
a ..x! (if foo then ..y! else ..) ..z!
var x$, y$, z$; x$ = a; y$ = x$.x(); z$ = foo ? y$.y() : y$; z$.z();
Pipe-chaining accessor functions:
a |> (.x!) |> -> if foo then it.y! else it |> (.z!)
(function(it){ return it.z(); })( function(it){ if (foo) { return it.y(); } else { return it; } }( function(it){ return it.x(); }( a)));
The suggested syntax would be clearer.
Sorry, something went wrong.
No branches or pull requests
I think it would be nice to have conditional function chaining, like the following:
...which will be compiled to:
This feature will be useful when we need a conditional middle step on a long function chain.
The text was updated successfully, but these errors were encountered: