Skip to content
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

The *switch directive #30

Open
lowlighter opened this issue Oct 8, 2024 · 0 comments
Open

The *switch directive #30

lowlighter opened this issue Oct 8, 2024 · 0 comments
Labels
scope: unstable spec Spec definition for non-well defined behaviors
Milestone

Comments

@lowlighter
Copy link
Owner

lowlighter commented Oct 8, 2024

Scope

unstable

What do you want to define?

A new *switch / *case directive

Current pattern:

<i *if="x === 'A'"></i>
<i *else="x === 'B'"></i>
<i *else="x === 'C'"></i>
<i *else></i>

Proposed pattern:

<i *switch="x" *case="'A'"></i>
<i *case="'B'"></i>
<i *case="'C'"></i>
<i *case.default></i>

This would be useful in case you want to only evaluate left operand once

I have searched for existing issues

Yes

@lowlighter lowlighter added this to the v0 milestone Oct 26, 2024
@lowlighter lowlighter added the spec Spec definition for non-well defined behaviors label Oct 29, 2024
@lowlighter lowlighter changed the title feat(switch): add a *switch directive The *switch directive Oct 29, 2024
@lowlighter lowlighter modified the milestones: v0, future Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: unstable spec Spec definition for non-well defined behaviors
Projects
None yet
Development

No branches or pull requests

1 participant