EN605.607.81.SP22_ASDM_Project/front_end/src/main.rs

31 lines
608 B
Rust
Raw Normal View History

2022-03-07 04:15:53 +00:00
mod ai;
mod async_js_helper;
mod constants;
mod game_logic;
mod html_helper;
mod random_helper;
mod state;
mod yew_components;
use state::SharedState;
use yew::prelude::*;
use yew_components::Wrapper;
2022-02-28 07:53:01 +00:00
#[function_component(App)]
pub fn app() -> Html {
2022-02-28 07:53:01 +00:00
let ctx = use_state(SharedState::default);
html! {
<ContextProvider<SharedState> context={(*ctx).clone()}>
<Wrapper />
</ContextProvider<SharedState>>
}
}
2022-02-28 04:49:40 +00:00
fn main() {
// setup logging to browser console
wasm_logger::init(wasm_logger::Config::default());
// start webapp
yew::start_app::<App>();
2022-02-28 04:49:40 +00:00
}