basic dioxus state
This commit is contained in:
+13
@@ -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}"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user