How to make a synchonous call to webassembly

Viewed 99

Normally when doing a webassembly call it will be called asynchronously with the following pattern:

API <-> Web Worker (async) <-> WASM

However, I have a use case where I need to call wasm with a synchronous call: in this case because the CopyToClipboard operation needs to be synchronous. Is this possible to do in webassembly? What would be the simplest example of doing a synchronous call in js<->wasm?

0 Answers
Related