Add toggle

This commit is contained in:
Jonathan Kelley committed 2023-10-15 17:52:01 -07:00
1 parent 741bfbc9ac
commit 7e2164d6d6
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ fn app(cx: Scope) -> Element {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
button { onclick: move |_| running.set(!running.value()), "Toggle counter" }
button { onclick: move |_| running.toggle(), "Toggle counter" }
button { onclick: move |_| saved_values.push(count.value()), "Save this value" }
// We can do boolean operations on the current signal value