You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use worked::*;#[wasm_bindgen(start)]pubasyncfnstart(){for i in0..20{factorial(
i.clone(),// <-- Function inputmove |o| gloo::console::log!(&format!("{i}! = {o}"))// <-- Callback).await;// <-- Await the spawning of the worker}}#[worked("/pkg/wasm_workers.js")]// <-- Absolute path to your main wasm_bindgen exportpubfnfactorial(n:i64) -> i64{// <-- Functions can only take one inputf(n)}#[wasm_bindgen]pubfnf(n:i64) -> i64{match n {0 => 1,
_ => n *f(n - 1),}}