about summary refs log tree commit diff
path: root/users/kranzes/wasm-hello-world/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/kranzes/wasm-hello-world/src/lib.rs')
-rw-r--r--users/kranzes/wasm-hello-world/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/users/kranzes/wasm-hello-world/src/lib.rs b/users/kranzes/wasm-hello-world/src/lib.rs
new file mode 100644
index 000000000000..c184214822e7
--- /dev/null
+++ b/users/kranzes/wasm-hello-world/src/lib.rs
@@ -0,0 +1,11 @@
+use wasm_bindgen::prelude::*;
+
+#[wasm_bindgen]
+extern "C" {
+    fn alert(s: &str);
+}
+
+#[wasm_bindgen]
+pub fn hello_world() {
+    alert("Hello World!");
+}