New issue
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
Add {@any} helper. #107
Add {@any} helper. #107
Conversation
Enables syntax such as:
|
I purposely made the deferral generation generic in case we want to add the equivalent |
lgtm, let's get one more set of eyes on it. |
More than one more set I think, this is a fairly large grammar addition. |
Has lots of value and slots in cleanly. Do you need a test with an any helper within another any helper within a select. That should just get diagnosed I think. |
That's a really good call-- that actually crashes the template. |
@rragan, are you OK with this syntax? I don't want you to feel like you're being run over-- your PR is the direct driver for this one. The team here was just worried about coming up with something that felt Dust-like. |
4602b3e
to
07a3ec4
Compare
- Must be contained in a {@select} block - Renders its body if any truth test inside the {@select} block evaluates to true - Can be included multiple times inside a {@select} block. As part of this change, {@select} no longer clobbers the current context, so keys that begin with a dot work inside a {@select}. This closes LinkedInAttic#9, closes LinkedInAttic#42, closes LinkedInAttic#50, and closes LinkedInAttic#79.
07a3ec4
to
f96f820
Compare
The syntax works for me. It is a bit odd using a "select/case" mechanism for achieving a multi-output OR mechanism -- the name becomes a misnomer for someone looking at how to achieve OR behavior. Docs can help --, e.g. Need to do a an OR, see Select |
@jimmyhchan whaddya think |
Add {@any} helper for use within an {@select} body.
When the "dust settles" on this round of changes and you are good to publish new dust and helpers, let me know and I can update the wiki. |
As part of this change, {@select} no longer clobbers the current context, so keys that begin with a dot work inside a {@select}. This closes #9, closes #42, closes #50, and closes #79.