1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use wasm_bindgen::prelude::*;

#[macro_use]
pub mod log;

pub mod ctx;
pub mod ws;

#[wasm_bindgen]
extern "C" {
  #[wasm_bindgen(js_namespace = console)]
  fn log(s: &str, style: &str);
}

#[wasm_bindgen]
pub fn dbui() {
  debug!("[{}] is starting", dbui_core::cfg::APPNAME);
  std::panic::set_hook(Box::new(console_error_panic_hook::hook));

  match crate::ctx::ClientContext::new() {
    Ok(_) => (),
    Err(e) => error!("Error starting [{}]: {:?}", dbui_core::cfg::APPNAME, e)
  };
}