mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-05 10:32:16 +00:00
12 lines
172 B
Rust
12 lines
172 B
Rust
use wasm_bindgen::prelude::*;
|
|
|
|
#[wasm_bindgen]
|
|
extern "C" {
|
|
fn alert(s: &str);
|
|
}
|
|
|
|
#[wasm_bindgen]
|
|
pub fn greet(name: &str) {
|
|
alert(&format!("Hello, {}!", name));
|
|
}
|