comet-web 0.1.6

Reactive Isomorphic Web Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use wasm_bindgen::prelude::*;

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

#[macro_export]
macro_rules! console_log {
    ($($t:tt)*) => {
        #[cfg(target_arch = "wasm32")]
        consolelog(&format_args!($($t)*).to_string());

        #[cfg(not(target_arch = "wasm32"))]
        println!($($t)*);
    }
}