Eval should never return an error
Only awaiting eval should error. Eval should always be available, even if using its methods returns errors.
This commit is contained in:
9 files changed
+65
-44
No files matched your search
@@ -24,12 +24,11 @@ fn app() -> Element {
|
||||
class: "eval-button",
|
||||
onclick: move |_| async move {
|
||||
let mut eval = eval(
|
||||
r#"
|
||||
window.document.title = 'Hello from Dioxus Eval!';
|
||||
dioxus.send("returned eval value");
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
r#"
|
||||
window.document.title = 'Hello from Dioxus Eval!';
|
||||
dioxus.send("returned eval value");
|
||||
"#,
|
||||
);
|
||||
|
||||
let result = eval.recv().await;
|
||||
if let Ok(serde_json::Value::String(string)) = result {
|
||||
|
||||
Reference in new issue
Block a user