Created
October 5, 2018 02:51
-
-
Save goofmint/475f43a6c47247c21c1f34b8bdf92825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate wasm_bindgen; | |
use wasm_bindgen::prelude::*; | |
#[wasm_bindgen] | |
extern "C" { | |
fn alert(s: &str); | |
} | |
#[wasm_bindgen] | |
pub fn greet(name: &str) { | |
alert(&format!("Hello, {}!", name)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment