tx2_web/utils.rs
1// This code is derived from
2// https://github.com/rustwasm/wasm-pack-template/blob/a3acfd295f0a10f2ddb6eebf6db10e057369df6a/src/utils.rs
3
4pub(crate) fn set_panic_hook() {
5 // When the `console_error_panic_hook` feature is enabled, we can call the
6 // `set_panic_hook` function at least once during initialization, and then
7 // we will get better error messages if our code ever panics.
8 //
9 // For more details see
10 // https://github.com/rustwasm/console_error_panic_hook#readme
11 #[cfg(feature = "console_error_panic_hook")]
12 console_error_panic_hook::set_once();
13}