Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created October 5, 2018 02:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save goofmint/475f43a6c47247c21c1f34b8bdf92825 to your computer and use it in GitHub Desktop.
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