Let's see how they work together with a few examples:
This is the "Hello, world!" example of #[wasm_bindgen] showing how to set up a project, export a function to JS, call it from JS, and then call the alert function in Rust.
This example shows off how to use console.log in a variety of ways, all the way from bare-bones usage to a println!-like macro with web_sys.
Julia set in wikipedia
All of the above examples use the main thread to run and this can freeze it on load. To solve this problem lets start use Web Workers. To begin we will integrate a simple console_log example into the Angular Web Worker.
View on GitHub