diff --git a/examples/todomvc/index.js b/examples/todomvc/index.js index 29a450d1..bc0a79ba 100644 --- a/examples/todomvc/index.js +++ b/examples/todomvc/index.js @@ -1,4 +1,7 @@ // For more comments about what's going on here, check out the `hello_world` // example -import('./pkg/todomvc') +const rust = import('./pkg/todomvc'); + +rust + .then(m => m.run()) .catch(console.error); diff --git a/examples/todomvc/src/controller.rs b/examples/todomvc/src/controller.rs index ebb0ccf4..bfad84c0 100644 --- a/examples/todomvc/src/controller.rs +++ b/examples/todomvc/src/controller.rs @@ -68,7 +68,7 @@ impl Controller { } pub fn set_page(&mut self, raw: String) { - let route = raw.trim_left_matches("#/"); + let route = raw.trim_start_matches("#/"); self.active_route = route.to_string(); self._filter(false); self.add_message(ViewMessage::UpdateFilterButtons(route.to_string()));