Add toggle
This commit is contained in:
2 files changed
+8
-1
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user