UNPKG

rust-wasm-react-calculator

Version:

This package is the result of compiling Rust in WASM with wasm-pack

26 lines (13 loc) 727 B
This package is the result of compiling Rust in WASM with wasm-pack ## This is not a production package This package is not tested, and is just the result of some fun and learning with Rust and Wasm Source code [HERE](https://github.com/krab7191/rust-wasm-calculator/tree/master/lib) ## Links: [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) [blog post tutorial with react](https://prestonrichey.com/blog/react-rust-wasm/) ## Usage: `// Import package` `const wasm = await import('rust-wasm-react-calculator'); // Wasm calls must be async` Call calculate with a simple expression as string `const expression = '14+5';` `wasm.calculate(expression); // Expression must have 1 operator, +, -, X, /, %, ^`