summaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: b5ad04095eeae124e1546003ab993391e04c77a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#![recursion_limit = "1024"]
extern crate console_error_panic_hook;
extern crate wee_alloc;
use std::panic;
use view::main::MainView;
use wasm_bindgen::prelude::*;
use yew::prelude::App;

// Use `wee_alloc` as the global allocator.
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

pub mod model;
pub mod view;

fn init() {
    panic::set_hook(Box::new(console_error_panic_hook::hook));
}

#[wasm_bindgen(start)]
pub fn run_app() {
    init();
    App::<MainView>::new().mount_to_body();
}