Experiment with call syntax only working for copy types
This commit is contained in:
19 files changed
+52
-76
No files matched your search
+3
-3
@@ -14,7 +14,7 @@ fn app() -> Element {
|
||||
// Signals are backed by a runtime that is designed to deeply integrate with Dioxus apps
|
||||
use_future(|| async move {
|
||||
loop {
|
||||
if running.value() {
|
||||
if running.cloned() {
|
||||
count += 1;
|
||||
}
|
||||
tokio::time::sleep(Duration::from_millis(400)).await;
|
||||
@@ -26,11 +26,11 @@ fn app() -> Element {
|
||||
button { onclick: move |_| count += 1, "Up high!" }
|
||||
button { onclick: move |_| count -= 1, "Down low!" }
|
||||
button { onclick: move |_| running.toggle(), "Toggle counter" }
|
||||
button { onclick: move |_| saved_values.push(count.value().to_string()), "Save this value" }
|
||||
button { onclick: move |_| saved_values.push(count.cloned().to_string()), "Save this value" }
|
||||
button { onclick: move |_| saved_values.write().clear(), "Clear saved values" }
|
||||
|
||||
// We can do boolean operations on the current signal value
|
||||
if count.value() > 5 {
|
||||
if count() > 5 {
|
||||
h2 { "High five!" }
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user