reearth / quickjs-emscripten-sync

Provides a way to sync objects between browser and QuickJS
MIT License
64 stars 7 forks source link

Doesn't work with asyncify #32

Open gaberogan opened 10 months ago

gaberogan commented 10 months ago

Would it be possible for this library to support asyncify? Currently if I want to marshal an asyncified function I can't do that e.g.

  vm.arena.expose({
    http: {
      fetchSync: vm.newAsyncifiedFunction(async () => {
        return await fetch(url).then(r => r.text())
      }),
    },
  })
rot1024 commented 8 months ago

I will check the latest update of quickjs-emscripten, but I'm busy, so it will take a little more time. (PR is anyime welcome)