cawfree / react-native-webassembly

⚛️ 🏎 WebAssembly for React Native powered by JSI.
https://twitter.com/cawfree
MIT License
291 stars 6 forks source link

Check wasm available functions #25

Open valavanisleonidas opened 8 months ago

valavanisleonidas commented 8 months ago

Hey,

I have loaded my wasm with WebAssembly.instantiate and i want to check the available functions because I am not sure which one is the name to call. Is that possible ?? I saw in an example

const importObject: any = {
        env: {
            print: function (x: any) { console.log(x); } // map the zig function print to the JS function console.log(x)
        },
    };

  const localModule1 = await WebAssembly.instantiate(LocalHello, importObject);

const fn = localModule1.instance.exports;
console.log(fn);

but it doesn't work.

valavanisleonidas commented 8 months ago

Checking the repository you suggested and loading the wasm using this library i get an error in the init function of the instance.exports.init() here. is this supported in this library ?? Thanks @cawfree