Skip to content
This repository was archived by the owner on Mar 2, 2021. It is now read-only.

Commit df5dadf

Browse files
committed
TodoMVC: add small note about why we forget in the router
1 parent 320d7d9 commit df5dadf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/todomvc/src/router.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ pub fn start(vdom: VdomWeak) {
5353
on_hash_change();
5454

5555
// Now listen for hash changes forever.
56+
//
57+
// Note that if we ever intended to unmount our todos app, we would want to
58+
// provide a method for removing this router's event listener and cleaning
59+
// up after ourselves.
5660
let on_hash_change = Closure::wrap(Box::new(on_hash_change) as Box<FnMut()>);
5761
let window = utils::window();
5862
window

0 commit comments

Comments
 (0)