basic dioxus state

This commit is contained in:
2024-05-21 21:38:40 -04:00
parent 7fb6e95c79
commit a2239cfe7e
5 changed files with 23 additions and 2 deletions
+13
View File
@@ -2,10 +2,23 @@
use dioxus::prelude::*;
pub struct State {
pub status: GlobalSignal<String>,
}
pub static STATE: State = State {
status: Signal::global(|| "Starting...".to_owned()),
};
pub fn app() -> Element {
use_coroutine(|_: UnboundedReceiver<()>| super::network_entrypoint());
let status = &STATE.status;
rsx!(
div {
"Hello, World!"
br {}
"{status}"
}
)
}