|
@@ -32,6 +32,17 @@ impl JSOwner {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#[wasm_bindgen::prelude::wasm_bindgen(module = "/src/js/eval.js")]
|
|
|
|
+extern "C" {
|
|
|
|
+ pub type WeakDioxusChannel;
|
|
|
|
+
|
|
|
|
+ #[wasm_bindgen(method, js_name = "rustSend")]
|
|
|
|
+ pub fn rust_send(this: &WeakDioxusChannel, value: wasm_bindgen::JsValue);
|
|
|
|
+
|
|
|
|
+ #[wasm_bindgen(method, js_name = "rustRecv")]
|
|
|
|
+ pub async fn rust_recv(this: &WeakDioxusChannel) -> wasm_bindgen::JsValue;
|
|
|
|
+}
|
|
|
|
+
|
|
#[wasm_bindgen::prelude::wasm_bindgen(module = "/src/js/eval.js")]
|
|
#[wasm_bindgen::prelude::wasm_bindgen(module = "/src/js/eval.js")]
|
|
extern "C" {
|
|
extern "C" {
|
|
pub type WebDioxusChannel;
|
|
pub type WebDioxusChannel;
|
|
@@ -54,13 +65,6 @@ extern "C" {
|
|
#[wasm_bindgen(method)]
|
|
#[wasm_bindgen(method)]
|
|
pub fn weak(this: &WebDioxusChannel) -> WeakDioxusChannel;
|
|
pub fn weak(this: &WebDioxusChannel) -> WeakDioxusChannel;
|
|
|
|
|
|
- pub type WeakDioxusChannel;
|
|
|
|
-
|
|
|
|
- #[wasm_bindgen(method, js_name = "rustSend")]
|
|
|
|
- pub fn rust_send(this: &WeakDioxusChannel, value: wasm_bindgen::JsValue);
|
|
|
|
-
|
|
|
|
- #[wasm_bindgen(method, js_name = "rustRecv")]
|
|
|
|
- pub async fn rust_recv(this: &WeakDioxusChannel) -> wasm_bindgen::JsValue;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/// Provides the Document through [`ScopeId::provide_context`].
|
|
/// Provides the Document through [`ScopeId::provide_context`].
|
|
@@ -136,7 +140,7 @@ impl Document for WebDocument {
|
|
const PROMISE_WRAPPER: &str = r#"
|
|
const PROMISE_WRAPPER: &str = r#"
|
|
return (async function(){
|
|
return (async function(){
|
|
{JS_CODE}
|
|
{JS_CODE}
|
|
-
|
|
|
|
|
|
+
|
|
dioxus.close();
|
|
dioxus.close();
|
|
})();
|
|
})();
|
|
"#;
|
|
"#;
|