Add init function to wasm-bindings crate and update dependencies (#33)

This commit is contained in:
ProTheory8
2021-03-27 02:26:54 -07:00
committed by Keavon Chambers
parent 8596db42ba
commit 018708791d
5 changed files with 34 additions and 99 deletions
+3 -7
View File
@@ -2,17 +2,13 @@ mod utils;
use wasm_bindgen::prelude::*;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
}
#[wasm_bindgen]
pub fn greet() {
#[wasm_bindgen(start)]
pub fn init() {
utils::set_panic_hook();
alert("Hello, Graphite!");
}