We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5871d64 commit ea8adcfCopy full SHA for ea8adcf
bindings/libraries/ts/index.ts
@@ -1,6 +1,13 @@
1
-import { greet as rustGreet } from '../rust_wasm/rust_wasm';
2
-import { greet as cppGreet } from '../cpp_wasm/cpp_wasm';
+import init, { greet as rustGreet } from '../rust_wasm/rust_wasm.js';
+import Module from '../cpp_wasm/cpp_wasm.js';
3
4
+async function run() {
5
+ await init(); // Inicializa o WASM
6
+ console.log(rustGreet('Rust'));
7
+}
8
-console.log(rustGreet('Rust'));
-console.log(cppGreet('C++'));
9
+run();
10
+
11
+Module().then((cppModule) => {
12
+ console.log(cppModule.greet('C++'));
13
+});
0 commit comments