Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the routing example #385

Merged
merged 3 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ target
**/*.rs.bk
Cargo.lock
orig.*
/.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .gitignore niceties may be out of scope for this PR, although I would appreciate them myself and I think a separate PR would be welcome.

Thank you for keeping the routing example in line with the rest of the project.

/cmake-build-debug
2 changes: 1 addition & 1 deletion examples/routing/src/b_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Component for BModel {
type Message = Msg;
type Properties = ();

fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self {
fn create(_: Self::Properties, mut link: ComponentLink<Self>) -> Self {

let callback = link.send_back(|route: Route<()>| Msg::HandleRoute(route));
let mut router = router::Router::bridge(callback);
Expand Down
2 changes: 1 addition & 1 deletion examples/routing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Component for Model {
type Message = Msg;
type Properties = ();

fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self {
fn create(_: Self::Properties, mut link: ComponentLink<Self>) -> Self {

let callback = link.send_back(|route: Route<()>| Msg::HandleRoute(route));
let mut router = router::Router::bridge(callback);
Expand Down
1 change: 1 addition & 0 deletions examples/showcase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
8 changes: 8 additions & 0 deletions examples/showcase/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -54,6 +56,7 @@ enum Scene {
LargeTable,
MountPoint,
NpmAndRest,
Routing,
Textarea,
Timer,
Todomvc,
Expand Down Expand Up @@ -176,6 +179,11 @@ impl Scene {
<NpmAndRest: />
}
}
Scene::Routing => {
html! {
<Routing: />
}
}
Scene::Textarea => {
html! {
<Textarea: />
Expand Down