Updated to recent spec with initial routing, and history

master
DavidOConnor 6 years ago
parent 02d535282a
commit c8df7d2c5a

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

@ -12,8 +12,8 @@
`cargo install wasm-bindgen-cli` `cargo install wasm-bindgen-cli`
- Run `build.sh` or `build.ps1`, then then start a dev server that supports WASM. - 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`. For example, with [Python](https://www.python.org/downloads/) installed, run `python pyserve.py`.
(Linux users may need to run `python3 server.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 Once you rename the crate in `Cargo.toml` (The `name` field under `[Package]`), make the
following changes: following changes:

@ -27,7 +27,7 @@ enum Msg {
Increment, Increment,
} }
fn update(msg: Msg, model: Model) -> Model { fn update(history: &mut History<Model, Msg>, msg: Msg, model: Model) -> Model {
match msg { match msg {
Msg::Increment => Model {val: model.val + 1} Msg::Increment => Model {val: model.val + 1}
} }
@ -45,5 +45,5 @@ fn view(model: Model) -> El<Msg> {
#[wasm_bindgen] #[wasm_bindgen]
pub fn render() { pub fn render() {
seed::run(Model::default(), update, view, "main"); seed::run(Model::default(), update, view, "main", None);
} }
Loading…
Cancel
Save