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