mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Fix worker startup blob script (#1013)
This commit is contained in:
parent
25b12d5a36
commit
8afeb03278
17
src/agent.rs
17
src/agent.rs
@ -1013,22 +1013,7 @@ fn worker_new(name_of_resource: &str, is_module: bool) -> Worker {
|
||||
let array = Array::new();
|
||||
array.push(
|
||||
&format!(
|
||||
r#"importScripts("{}");
|
||||
|
||||
let initialized = wasm_bindgen("{}").catch(err => {{
|
||||
// Propagate to main `onerror`:
|
||||
setTimeout(() => {{
|
||||
throw err;
|
||||
}});
|
||||
|
||||
// Rethrow to keep promise rejected and prevent execution of further commands:
|
||||
throw err;
|
||||
}});
|
||||
|
||||
self.onmessage = async (event) => {{
|
||||
await initialized;
|
||||
wasm_bindgen.child_entry_point(event.data);
|
||||
}};"#,
|
||||
r#"importScripts("{}");wasm_bindgen("{}");"#,
|
||||
script_url, wasm_url
|
||||
)
|
||||
.into(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user