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!"