This rust workspace comprises of 2 crates:
- ios_calculator - An implementation of the basic iOS calculator
- wasm_ios_calculator - A wrapper for ios_calculator that compiles to WebAssembly and uses wasm_bindgen to expose its methods.
WASM iOS calculator can be built using wasm-pack by executing the following in the current directory:
wasm-pack build ./wasm_ios_calculator --out-dir ../pkg
This will create a /pkg
directory that contains the .wasm output along with Typescript bindings.
The /pkg
directory can then be added as a local dependency for a npm project.