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

Empty false condition for builder dyn_if #604

Open
dessalines opened this issue Apr 26, 2023 · 0 comments · May be fixed by #669
Open

Empty false condition for builder dyn_if #604

dessalines opened this issue Apr 26, 2023 · 0 comments · May be fixed by #669
Labels
A-builder Area: builder API C-enhancement Category: new feature or improvement to existing feature

Comments

@dessalines
Copy link

dessalines commented Apr 26, 2023

I often only want to show something in the true condition, but the dyn_if function has three arguments:

  • Condition
  • True case
  • False case

The false case should probably either be an Option type, or there should be a helper function that is just empty html.

Currently I'm doing:

.dyn_if(|| condition, || ..., || fragment([]) as a workaround.

@dessalines dessalines changed the title for builder dyn_if Empty false condition for builder dyn_if Apr 26, 2023
@lukechu10 lukechu10 added C-enhancement Category: new feature or improvement to existing feature A-builder Area: builder API labels Apr 26, 2023
@lukechu10 lukechu10 linked a pull request Apr 3, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builder Area: builder API C-enhancement Category: new feature or improvement to existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants