Update for 0.3.0

master
David O'Connor 6 years ago
parent 02978ed825
commit eddddb0a07

@ -10,7 +10,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
seed = "^0.2.10" seed = "^0.3.0"
wasm-bindgen = "^0.2.37" wasm-bindgen = "^0.2.37"
web-sys = "^0.3.6" web-sys = "^0.3.6"

@ -1,2 +1,2 @@
cargo build --target wasm32-unknown-unknown cargo build --target wasm32-unknown-unknown --release
wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no-modules --out-dir ./pkg --out-name package wasm-bindgen target/wasm32-unknown-unknown/release/appname.wasm --no-modules --out-dir ./pkg --out-name package

@ -1,3 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cargo build --target wasm32-unknown-unknown cargo build --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no-modules --out-dir ./pkg --out-name package wasm-bindgen target/wasm32-unknown-unknown/debug/appname.wasm --no-modules --out-dir ./pkg --out-name package
#cargo build --target wasm32-unknown-unknown --release
#wasm-bindgen target/wasm32-unknown-unknown/release/appname.wasm --no-modules --out-dir ./pkg --out-name package

@ -25,16 +25,17 @@ enum Msg {
Increment, Increment,
} }
fn update(msg: Msg, model: Model) -> Update<Msg, Model> { fn update(msg: Msg, model: &mut Model) -> Update<Msg> {
match msg { match msg {
Msg::Increment => Render(Model {val: model.val + 1}) Msg::Increment => model.val += 1,
} }
Render.into()
} }
// View // View
fn view(_state: seed::App<Msg, Model>, model: &Model) -> El<Msg> { fn view(model: &Model) -> El<Msg> {
button![ button![
simple_ev(Ev::Click, Msg::Increment), simple_ev(Ev::Click, Msg::Increment),
format!("Hello, World × {}", model.val) format!("Hello, World × {}", model.val)

Loading…
Cancel
Save