only re-render if the state has changed

This commit is contained in:
Evan Almloff 2022-05-07 09:10:34 -05:00
parent 83209e5e03
commit 2ea587359b

View file

@ -129,7 +129,7 @@ fn render_vdom(
terminal.clear().unwrap();
}
let to_rerender: fxhash::FxHashSet<usize> = vec![0].into_iter().collect();
let mut to_rerender: fxhash::FxHashSet<usize> = vec![0].into_iter().collect();
let mut resized = true;
loop {
@ -226,7 +226,7 @@ fn render_vdom(
// update the style and layout
let mut any_map = AnyMap::new();
any_map.insert(stretch.clone());
let _to_rerender = rdom.update_state(vdom, to_update, any_map).unwrap();
to_rerender = rdom.update_state(vdom, to_update, any_map).unwrap();
}
}