1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-28 04:01:33 +00:00
Files
.cargo
crates
examples
add
canvas
char
closures
console_log
dom
duck-typed-interfaces
fetch
guide-supported-types-examples
hello_world
src
Cargo.toml
README.md
index.js
package.json
webpack.config.js
import_js
julia_set
no_modules
paint
performance
raytrace-parallel
request-animation-frame
todomvc
wasm-in-wasm
wasm2js
webaudio
webgl
.gitignore
README.md
guide
releases
src
tests
.appveyor.yml
.gitattributes
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md
build.rs
package.json
publish.rs
wasm-bindgen/examples/hello_world/index.js

9 lines
290 B
JavaScript
Raw Normal View History

// Note that a dynamic `import` statement here is required due to
// webpack/webpack#6615, but in theory `import { greet } from './pkg/hello_world';`
// will work here one day as well!
const rust = import('./pkg/hello_world');
rust
.then(m => m.greet('World!'))
.catch(console.error);