Skip to content

Commit ea8adcf

Browse files
author
22388o
committed
Fix TS bindings
1 parent 5871d64 commit ea8adcf

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

bindings/libraries/ts/index.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
import { greet as rustGreet } from '../rust_wasm/rust_wasm';
2-
import { greet as cppGreet } from '../cpp_wasm/cpp_wasm';
1+
import init, { greet as rustGreet } from '../rust_wasm/rust_wasm.js';
2+
import Module from '../cpp_wasm/cpp_wasm.js';
33

4+
async function run() {
5+
await init(); // Inicializa o WASM
6+
console.log(rustGreet('Rust'));
7+
}
48

5-
console.log(rustGreet('Rust'));
6-
console.log(cppGreet('C++'));
9+
run();
10+
11+
Module().then((cppModule) => {
12+
console.log(cppModule.greet('C++'));
13+
});

0 commit comments

Comments
 (0)