Get cargo check --all working

This commit is contained in:
Jonathan Kelley committed 2024-01-18 19:27:55 -08:00
1 parent d8af9b7ed1
commit 6ed3aafb2f
34 files changed
+80 -122

No files matched your search

+8 -11
View File
@@ -54,23 +54,20 @@ struct AppProps {
}
#[allow(unused)]
fn app(cx: Scope<AppProps>) -> Element {
let mut count = use_signal(|| cx.props.count);
let text = use_signal(|| "...".to_string());
fn app(props: AppProps) -> Element {
let mut count = use_signal(|| props.count);
let mut text = use_signal(|| "...".to_string());
rsx! {
h1 { "hello axum! {count}" }
button { class: "increment-button", onclick: move |_| count += 1, "Increment" }
button {
class: "server-button",
onclick: move |_| {
to_owned![text];
async move {
if let Ok(data) = get_server_data().await {
println!("Client received: {}", data);
text.set(data.clone());
post_server_data(data).await.unwrap();
}
onclick: move |_| async move {
if let Ok(data) = get_server_data().await {
println!("Client received: {}", data);
text.set(data.clone());
post_server_data(data).await.unwrap();
}
},
"Run a server function!"
+8 -9
View File
@@ -4,7 +4,7 @@ use dioxus::prelude::*;
fn app() -> Element {
let mut num = use_signal(|| 0);
let eval_result = use_signal(String::new);
let mut eval_result = use_signal(String::new);
rsx! {
div {
@@ -22,19 +22,18 @@ fn app() -> Element {
div { class: "style-div", color: "red", "colored text" }
button {
class: "eval-button",
onclick: move |_| {
let eval = eval(
onclick: move |_| async move {
let mut eval = eval(
r#"
window.document.title = 'Hello from Dioxus Eval!';
dioxus.send("returned eval value");
"#,
)
.unwrap();
async move {
let result = eval.recv().await;
if let Ok(serde_json::Value::String(string)) = result {
eval_result.set(string);
}
let result = eval.recv().await;
if let Ok(serde_json::Value::String(string)) = result {
eval_result.set(string);
}
},
"Eval"
@@ -44,5 +43,5 @@ fn app() -> Element {
}
fn main() {
launch_web(app);
launch(app);
}