Add this_algorithm-wasm

This commit is contained in:
Austen Adler 2023-02-25 11:14:25 -05:00
parent 213f7fd3e7
commit c20d2f3085
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,13 @@
[package]
name = "this_algorithm-wasm"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2"
# this_algorithm = {path=".."}

View File

@ -0,0 +1,11 @@
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
pub fn alert(s: &str);
}
#[wasm_bindgen]
pub fn greet(name: &str) {
alert(&format!("Hello, {}!", name));
}