From 496b74c4568f51e676b0ee8f16e868e705cdb512 Mon Sep 17 00:00:00 2001 From: Stephan Buys Date: Tue, 4 Sep 2018 18:41:09 +0200 Subject: [PATCH 1/3] Fix the routing example --- examples/routing/src/b_component.rs | 2 +- examples/routing/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/routing/src/b_component.rs b/examples/routing/src/b_component.rs index 87d33b2f7a7..dc614f58c23 100644 --- a/examples/routing/src/b_component.rs +++ b/examples/routing/src/b_component.rs @@ -24,7 +24,7 @@ impl Component for BModel { type Message = Msg; type Properties = (); - fn create(_: Self::Properties, link: ComponentLink) -> Self { + fn create(_: Self::Properties, mut link: ComponentLink) -> Self { let callback = link.send_back(|route: Route<()>| Msg::HandleRoute(route)); let mut router = router::Router::bridge(callback); diff --git a/examples/routing/src/lib.rs b/examples/routing/src/lib.rs index 91f00f79b6f..619f1fb93bb 100644 --- a/examples/routing/src/lib.rs +++ b/examples/routing/src/lib.rs @@ -36,7 +36,7 @@ impl Component for Model { type Message = Msg; type Properties = (); - fn create(_: Self::Properties, link: ComponentLink) -> Self { + fn create(_: Self::Properties, mut link: ComponentLink) -> Self { let callback = link.send_back(|route: Route<()>| Msg::HandleRoute(route)); let mut router = router::Router::bridge(callback); From 386e5e9f057fdf829ceb0ddc7bafe8ee978509ab Mon Sep 17 00:00:00 2001 From: Stephan Buys Date: Tue, 4 Sep 2018 21:59:01 +0300 Subject: [PATCH 2/3] Add idea and cmake to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6ff1aa25501..8588143dfd1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ target **/*.rs.bk Cargo.lock orig.* +/.idea +/cmake-build-debug From 1662970fcb15855915ec799ad9cd7e72d189b85b Mon Sep 17 00:00:00 2001 From: Denis Kolodin Date: Tue, 4 Sep 2018 22:01:16 +0300 Subject: [PATCH 3/3] Add the routing example to the showcase --- examples/showcase/Cargo.toml | 1 + examples/showcase/src/main.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/examples/showcase/Cargo.toml b/examples/showcase/Cargo.toml index 44a911947a1..4a5122eee8e 100644 --- a/examples/showcase/Cargo.toml +++ b/examples/showcase/Cargo.toml @@ -19,6 +19,7 @@ inner_html = { path = "../inner_html" } large_table = { path = "../large_table" } mount_point = { path = "../mount_point" } npm_and_rest = { path = "../npm_and_rest" } +routing = { path = "../routing" } textarea = { path = "../textarea" } timer = { path = "../timer" } todomvc = { path = "../todomvc" } diff --git a/examples/showcase/src/main.rs b/examples/showcase/src/main.rs index 790b53dd114..110327cc8cb 100644 --- a/examples/showcase/src/main.rs +++ b/examples/showcase/src/main.rs @@ -18,6 +18,7 @@ extern crate inner_html; extern crate large_table; extern crate mount_point; extern crate npm_and_rest; +extern crate routing; extern crate textarea; extern crate timer; extern crate todomvc; @@ -36,6 +37,7 @@ use inner_html::Model as InnerHtml; use large_table::Model as LargeTable; use mount_point::Model as MountPoint; use npm_and_rest::Model as NpmAndRest; +use routing::Model as Routing; use textarea::Model as Textarea; use timer::Model as Timer; use todomvc::Model as Todomvc; @@ -54,6 +56,7 @@ enum Scene { LargeTable, MountPoint, NpmAndRest, + Routing, Textarea, Timer, Todomvc, @@ -176,6 +179,11 @@ impl Scene { } } + Scene::Routing => { + html! { + + } + } Scene::Textarea => { html! {