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

Simplify if only in view #574

Open
johan-smits opened this issue Feb 10, 2023 · 0 comments
Open

Simplify if only in view #574

johan-smits opened this issue Feb 10, 2023 · 0 comments
Labels
A-ergonomics Area: API ergonomics A-view Area: view! macro

Comments

@johan-smits
Copy link

Currently if you want to show something if it is set and nothing if not you have to write this:

(if *something.get() {
  view! { cx, "Enabled" }
} else {
  view! { cx, }
})
``

You want to write just this without the else case:

```rs
(if *something.get() {
  view! { cx, "Enabled" }
})
``
@johan-smits johan-smits changed the title Simplify if else in view Simplify if only in view Feb 10, 2023
@lukechu10 lukechu10 added A-ergonomics Area: API ergonomics A-view Area: view! macro labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ergonomics Area: API ergonomics A-view Area: view! macro
Projects
None yet
Development

No branches or pull requests

2 participants