You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to make, for example, a requestAnimationFrame function and pass that into Wasm via the imports object.
The AssemblyScript user should be able to dynamically create and pass any callback to this function.
So on the JavaScript side, it would be something like:
constimports={requestAnimationFrame(assemblyscriptFunction){// call assemblyscriptFunction at some point, f.e.requestAnimationFrame(assemblyscriptFunction)}}
Problem is, at the moment, assemblyscriptFunction is an AssemblyScript pointer number. So the above won't work.
I'm not sure how to get a function using its pointer and call it, but once we know how to do that, then we can abstract it in as-bind.
Similarly, although maybe less useful, we should be able to pass JS functions into an AS function going the other way.