Showcase SwiftWasm code that's impossible to accomplish without Asyncify method:
- Sleeping inside synchronous code, without resorting to callback (or Swift Next's async/await).
- An initializer (which needs to return synchronously) that depends on asynchronous code from the outside world.
- Install the SwiftWasm toolchain
- Set SwiftWasm's
swift
as default or edit the swift command inbuild.sh
. - Install the Binaryen toolchain (we'll use the
wasm-opt
tool from there). - Set Binaryen's
/bin
in PATH or edit the wasm-opt command inbuild.sh
.
npm install
npm run build
./build.sh
Output files are written to /dist folder.