3 ms·
I’m not clear on the benefits of this proposal over just using anonymous functions. Some of the examples just seem contrived. And the React example makes no se
by yunohn 3y ago
I’m not clear on the benefits of this proposal over just using anonymous functions. Some of the examples just seem contrived.
And the React example makes no sense, you can use a ternary and it is even shorter.
```
return (
<nav>
<Home />
{loggedIn
? <LogoutButton />
: <LoginButton />
}
</nav>
)
```
- baq 3y agofor me the point is to be able to return from inside multiple expressions from the correct scope i.e. the root function without throwing.
- doctormanhatten 3y agoHaving written quite a lot of Reason react (similar in syntax to the proposed React example) - while in this particular case because the example is so simple the ternary looks nicer, its also nice to just have a longer expression block in the middle of your JSX when you're doing more complex things.
- graftak 3y agoWhat if you want a `switch` instead?