TodoMVC: add small note about why we `forget` in the router
commitdf5dadf9a1dc3aed07b4c4a62ef492716de2cf51
authorNick Fitzgerald <fitzgen@gmail.com>
dateTue 12 Feb 2019, 11:14 (8 years ago)
parent320d7d9
examples/todomvc/src/router.rs+4
@@ -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