From 32c5bd29840ae282adecbc6eb904708fbe5ded5e Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Thu, 13 Aug 2020 07:57:30 -0400 Subject: [PATCH] Update template index to run "Hello world!" The current implementation doesn't seem to run the function that was exported from Rust, `main_js()`. At first, I thought this was intentional, but the [current docs](https://github.com/rustwasm/wasm-pack/blob/master/docs/src/tutorials/hybrid-applications-with-webpack/using-your-library.md) which are out of date and say that a `run()` function should be here. I'll add a link to my change to the docs here shortly. --- template/js/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/js/index.js b/template/js/index.js index 9db81ab..dadf04d 100644 --- a/template/js/index.js +++ b/template/js/index.js @@ -1 +1,5 @@ -import("../pkg/index.js").catch(console.error); +import("../pkg/index.js") + .then((module) => { + module.main_js(); + }) + .catch(console.error);