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
+7
View File
@@ -1,5 +1,6 @@
pub mod app;
use app::STATE;
use wasm_bindgen::prelude::*;
use web_sys::console;
use web_sys::WebTransport;
@@ -42,6 +43,8 @@ pub async fn network_entrypoint() {
console::log_1(&"Created WebTransportOptions!".into());
*STATE.status.write() = "Connecting to WebTransport...".into();
let transport = match WebTransport::new_with_options(
"https://localhost:4433/?hostname=ohea.xyz&port=64738&username=test",
&options,
@@ -64,6 +67,8 @@ pub async fn network_entrypoint() {
console::log_1(&"Transport is ready.".into());
*STATE.status.write() = "Creating stream...".into();
let stream: web_sys::WebTransportBidirectionalStream =
match wasm_bindgen_futures::JsFuture::from(transport.create_bidirectional_stream()).await {
Ok(x) => x.into(),
@@ -78,4 +83,6 @@ pub async fn network_entrypoint() {
console::log_1(&"Created bidirectional stream!".into());
console::log_1(&stream.into());
//*STATE.status.write() = "Ready!".into();
}