Add error to JsValue conversion and example (#691)
This commit is contained in:
committed by
Sean McArthur
parent
57300edbc4
commit
43f2ff083c
12
examples/wasm_github_fetch/index.js
Normal file
12
examples/wasm_github_fetch/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const rust = import('./pkg');
|
||||
|
||||
rust
|
||||
.then(m => {
|
||||
return m.run().then((data) => {
|
||||
console.log(data);
|
||||
|
||||
console.log("The latest commit to the wasm-bindgen %s branch is:", data.name);
|
||||
console.log("%s, authored by %s <%s>", data.commit.sha, data.commit.commit.author.name, data.commit.commit.author.email);
|
||||
})
|
||||
})
|
||||
.catch(console.error);
|
||||
Reference in New Issue
Block a user