mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 00:08:13 +08:00
Add init function to wasm-bindings crate and update dependencies (#33)
This commit is contained in:
committed by
Keavon Chambers
parent
8596db42ba
commit
018708791d
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user