From c8df7d2c5affaa8e81cd9e44083ffd9c3a13a528 Mon Sep 17 00:00:00 2001 From: DavidOConnor Date: Mon, 17 Dec 2018 18:26:47 -0500 Subject: [PATCH] Updated to recent spec with initial routing, and history --- Cargo.toml | 2 +- README.md | 4 ++-- server.py => serve.py | 0 src/lib.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename server.py => serve.py (100%) diff --git a/Cargo.toml b/Cargo.toml index 9651903..2be0bef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" crate-type = ["cdylib"] [dependencies] -seed = "^0.1.4" +seed = "^0.1.7" wasm-bindgen = "^0.2.29" web-sys = "^0.3.6" diff --git a/README.md b/README.md index 8f43a8f..d3d00f1 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ `cargo install wasm-bindgen-cli` - Run `build.sh` or `build.ps1`, then then start a dev server that supports WASM. -For example, with [Python](https://www.python.org/downloads/) installed, run `python server.py`. -(Linux users may need to run `python3 server.py`.) +For example, with [Python](https://www.python.org/downloads/) installed, run `python pyserve.py`. +(Linux users may need to run `python3 serve.py`.) Once you rename the crate in `Cargo.toml` (The `name` field under `[Package]`), make the following changes: diff --git a/server.py b/serve.py similarity index 100% rename from server.py rename to serve.py diff --git a/src/lib.rs b/src/lib.rs index 58b028c..806cfea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ enum Msg { Increment, } -fn update(msg: Msg, model: Model) -> Model { +fn update(history: &mut History, msg: Msg, model: Model) -> Model { match msg { Msg::Increment => Model {val: model.val + 1} } @@ -45,5 +45,5 @@ fn view(model: Model) -> El { #[wasm_bindgen] pub fn render() { - seed::run(Model::default(), update, view, "main"); + seed::run(Model::default(), update, view, "main", None); } \ No newline at end of file