Updated for update func taking Model, and removed nightly instructions

master
DavidOConnor 6 years ago
parent 44e3d2de8e
commit dae1e76e35

1
.gitignore vendored

@ -9,3 +9,4 @@ pkg/*.wasm
pkg/*.d.ts
pkg/*.ts
pkg/*.js
wasm-pack.log

@ -9,7 +9,7 @@ edition = "2018"
crate-type = ["cdylib"]
[dependencies]
seed = "^0.1.0"
seed = "^0.1.2"
wasm-bindgen = "^0.2.29"
web-sys = "^0.3.6"

@ -3,19 +3,16 @@
**To get started:**
- Clone this repo
- If you don't have Rust installed, nightly set up, and wasm-bindgen, [Download it](https://www.rust-lang.org), and run the following commands:
- If you don't have Rust and wasm-bindgen installed, [Download it](https://www.rust-lang.org), and run the following commands:
`rustup update`
`rustup default nightly`
`rustup target add wasm32-unknown-unknown`
`rustup target add wasm32-unknown-unknown --toolchain nightly`
`cargo +nightly install wasm-bindgen-cli`
`cargo install wasm-bindgen-cli`
- Run `build.sh` or `build.ps1`, then open `index.html` in a web browser, or use a local server. (Opening the file directly may not work in some browsers.)
Once you rename the crate in `Cargo.toml` (The `name` field under `[Package]`), make the
following changes:

@ -27,7 +27,7 @@ enum Msg {
Increment,
}
fn update(msg: Msg, model: &Model) -> Model {
fn update(msg: Msg, model: Model) -> Model {
match msg {
Msg::Increment => Model {val: model.val + 1}
}

@ -1 +0,0 @@
Dec 11 19:15:53.330 ERRO Compiling your crate to WebAssembly
Loading…
Cancel
Save