From a35bcaea8d64e5c2ce1f608ee07cf92a0d9b823a Mon Sep 17 00:00:00 2001 From: DavidOConnor Date: Sat, 26 Jan 2019 17:17:40 -0500 Subject: [PATCH] Updated for v0.2.4 release --- Cargo.toml | 2 +- index.html | 2 +- src/lib.rs | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2d062c3..b6c28c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] -seed = "^0.2.3" +seed = "^0.2.4" wasm-bindgen = "^0.2.33" web-sys = "^0.3.6" diff --git a/index.html b/index.html index 8cb6f2f..0291a3c 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ -
+
diff --git a/src/lib.rs b/src/lib.rs index 4adf64d..e2f2d43 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,16 +26,16 @@ enum Msg { Increment, } -fn update(msg: Msg, model: Model) -> Model { +fn update(msg: Msg, model: Model) -> Update { match msg { - Msg::Increment => Model {val: model.val + 1} + Msg::Increment => Render(Model {val: model.val + 1}) } } // View -fn view(_state: seed::App, model: Model) -> El { +fn view(_state: seed::App, model: &Model) -> El { button![ simple_ev("click", Msg::Increment), format!("Hello, World × {}", model.val) @@ -44,5 +44,8 @@ fn view(_state: seed::App, model: Model) -> El { #[wasm_bindgen] pub fn render() { - seed::run(Model::default(), update, view, "main", None, None); + seed::App::build(Model::default(), update, view) + .finish() + .run(); + } \ No newline at end of file