28 lines
907 B
Rust
28 lines
907 B
Rust
// (Lines like the one below ignore selected Clippy rules
|
|
// - it's useful when you want to check your code with `cargo make verify`
|
|
// but some rules are too "annoying" or are not applicable for your case.)
|
|
#![allow(clippy::wildcard_imports)]
|
|
|
|
use log::Level;
|
|
use seed::{prelude::wasm_bindgen, App};
|
|
|
|
mod api;
|
|
mod consts;
|
|
mod graphql;
|
|
mod state;
|
|
mod view;
|
|
|
|
// (This function is invoked by `init` function in `index.html`.)
|
|
#[wasm_bindgen(start)]
|
|
pub fn start() {
|
|
// This provides better error messages in debug mode.
|
|
// It's disabled in release mode so it doesn't bloat up the file size.
|
|
#[cfg(debug_assertions)]
|
|
console_error_panic_hook::set_once();
|
|
|
|
let lvl = Level::Info;
|
|
console_log::init_with_level(lvl).expect("failed to initialize console logging");
|
|
// Mount the `app` to the element with the `id` "app".
|
|
App::start("app", state::init, state::update, view::view);
|
|
}
|