wasm-bindgen/examples/dom/index.js
Alex Crichton bc36b6f84b Add catch(console.error) to all examples
Some examples have been failing to load in some browsers, and this
ensures that whenever the promise to load Rust code fails we log any
errors happening instead of accidentally failing silently.

This helped debug a bit in #897
2018-09-28 13:55:07 -07:00

7 lines
170 B
JavaScript

// For more comments about what's going on here, check out the `hello_world`
// example
const rust = import('./dom');
rust
.then(m => m.run())
.catch(console.error);