wasm_web_reajason/lib.rs
1mod utils;
2
3use wasm_bindgen::prelude::*;
4
5// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
6// allocator.
7#[cfg(feature = "wee_alloc")]
8#[global_allocator]
9static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
10
11#[wasm_bindgen]
12extern {
13 fn alert(s: &str);
14}
15
16#[wasm_bindgen]
17pub fn greet() {
18 alert("Hello, wasm-web!");
19}
20
21pub fn hello(s: &str){
22 alert(&format!("Hello, {}!", s));
23}