Skip to content

Commit

Permalink
Merge #385
Browse files Browse the repository at this point in the history
385: fix the routing example r=DenisKolodin a=stephanbuys

The links need to be mutable.

Co-authored-by: Stephan Buys <hello@stephanbuys.com>
Co-authored-by: Denis Kolodin <deniskolodin@gmail.com>
  • Loading branch information
3 people committed Sep 4, 2018
2 parents e167a00 + 1662970 commit e6fc66e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
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
/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

0 comments on commit e6fc66e

Please sign in to comment.