more fullstack cleanups: loaders serialize, ServeConfig only (#4785)

* some opinionated cleanups in dioxus-server

* add serialize to loader

* add `result` to Resource

* clippy

* fix

* writable memos, resources, `onmount`, `.pending`, and `.value()` on actions

* fix compile issues

* fix typo
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-14 17:34:52 -07:00
1 parent a3e40a5ea2
commit 7102bc3b6a
33 files changed
+2085 -672

No files matched your search

@@ -43,11 +43,11 @@ fn app() -> Element {
h2 { class: "text-2xl font-bold", "Scan for Bluetooth Devices" }
button {
class: "inline-block w-full md:w-auto px-6 py-3 font-medium text-white bg-indigo-500 hover:bg-indigo-600 rounded transition duration-200",
disabled: scan.is_pending(),
disabled: scan.pending(),
onclick: move |_| {
scan.call();
},
if scan.is_pending() { "Scanning" } else { "Scan" }
if scan.pending() { "Scanning" } else { "Scan" }
}
}
}
@@ -64,8 +64,8 @@ fn app() -> Element {
th { class: "pb-3 px-2 font-medium", "Security" }
}
}
match scan.result() {
None if scan.is_pending() => rsx! { "Scanning..." },
match scan.value() {
None if scan.pending() => rsx! { "Scanning..." },
None => rsx! { "Press Scan to start scanning" },
Some(Err(_err)) => rsx! { "Failed to scan" },
Some(Ok(peripherals)) => rsx! {