react-native-webassembly icon indicating copy to clipboard operation
react-native-webassembly copied to clipboard

Check wasm available functions

Open valavanisleonidas opened this issue 2 years ago • 1 comments

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 avatar Dec 11 '23 11:12 valavanisleonidas

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

valavanisleonidas avatar Dec 11 '23 13:12 valavanisleonidas